@gobing-ai/spur 0.3.97 → 0.3.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/package.json +1 -1
- package/plugins/sp/README.md +9 -9
- package/plugins/sp/lib/inline-run.generated.mjs +16 -9
- package/plugins/sp/plugin.json +1 -1
- package/plugins/sp/references/roles.md +3 -3
- package/plugins/sp/scripts/inline-run-setup.mjs +4 -2
- package/plugins/sp/scripts/inline-run-setup.ts +12 -12
- package/plugins/sp/skills/code-implementation/SKILL.md +1 -1
- package/plugins/sp/skills/conflict-finding/SKILL.md +1 -1
- package/plugins/sp/skills/conflict-finding/references/authority-resolution.md +5 -3
- package/plugins/sp/skills/conflict-finding/references/remediation-routing.md +9 -8
- package/plugins/sp/skills/doc-evolve/SKILL.md +4 -3
- package/plugins/sp/skills/spur-cli/references/tasks/section-editing.md +7 -4
- package/plugins/sp/skills/spur-cli/references/tasks/verbs.md +7 -4
- package/plugins/sp/skills/spur-dev/references/dev-operations.md +16 -13
- package/plugins/sp/skills/spur-dev/references/execution-batch.md +1 -1
- package/plugins/sp/skills/spur-dev/references/flag-glossary.md +7 -8
- package/plugins/sp/skills/spur-dev/references/inline-pipeline-driver.md +3 -0
- package/spur.js +483 -254
- package/web/_astro/{BoardApp.vveLOdDq.js → BoardApp.CYbe-OTb.js} +5 -5
- package/web/_astro/{BoardApp.Bmv5WkJ9.js → BoardApp.Dflq5a8x.js} +1 -1
- package/web/_astro/{TaskDetail.IKc3uDYV.js → TaskDetail.CK7oXddP.js} +1 -1
- package/web/_astro/{arc.C63Ufg35.js → arc.BIqkDATc.js} +1 -1
- package/web/_astro/{architectureDiagram-3BPJPVTR.CP8Hyldk.js → architectureDiagram-3BPJPVTR.D0B3SvWv.js} +1 -1
- package/web/_astro/{blockDiagram-GPEHLZMM.Bo_48MRA.js → blockDiagram-GPEHLZMM.C2YyKQmL.js} +1 -1
- package/web/_astro/{c4Diagram-AAUBKEIU.Ch61sw-O.js → c4Diagram-AAUBKEIU.DmtTYrt_.js} +1 -1
- package/web/_astro/channel.JuKVyuhZ.js +1 -0
- package/web/_astro/{chunk-2J33WTMH.CHpzS7xf.js → chunk-2J33WTMH.HsRXbh7l.js} +1 -1
- package/web/_astro/{chunk-4BX2VUAB.DzMNNWIw.js → chunk-4BX2VUAB.obE_P-R3.js} +1 -1
- package/web/_astro/{chunk-55IACEB6.BqPrDw_Q.js → chunk-55IACEB6.CjWTF5mz.js} +1 -1
- package/web/_astro/{chunk-727SXJPM.ZzBHhNw-.js → chunk-727SXJPM.DMo799Ax.js} +1 -1
- package/web/_astro/{chunk-AQP2D5EJ.1_O_LLkx.js → chunk-AQP2D5EJ.-cE6JOKZ.js} +1 -1
- package/web/_astro/{chunk-FMBD7UC4.GS4UHg7_.js → chunk-FMBD7UC4.D6Rw6HIk.js} +1 -1
- package/web/_astro/{chunk-ND2GUHAM.BnqotN4g.js → chunk-ND2GUHAM.d5rBD73Z.js} +1 -1
- package/web/_astro/{chunk-QZHKN3VN.Ghuh8zoJ.js → chunk-QZHKN3VN.r3ox40Q3.js} +1 -1
- package/web/_astro/{classDiagram-4FO5ZUOK.BW9vC3zg.js → classDiagram-4FO5ZUOK.CGGbvjjJ.js} +1 -1
- package/web/_astro/{classDiagram-v2-Q7XG4LA2.BW9vC3zg.js → classDiagram-v2-Q7XG4LA2.CGGbvjjJ.js} +1 -1
- package/web/_astro/{cose-bilkent-S5V4N54A.D6jNC0ti.js → cose-bilkent-S5V4N54A.CmKtPd4l.js} +1 -1
- package/web/_astro/{cynefin-OW5HDTMX.BOGoCs4L.js → cynefin-OW5HDTMX.QNg5GXs8.js} +1 -1
- package/web/_astro/{dagre-BM42HDAG.8iU5VcWi.js → dagre-BM42HDAG.B1SabsjC.js} +1 -1
- package/web/_astro/{diagram-2AECGRRQ.CVt88HwH.js → diagram-2AECGRRQ.RtDbNj89.js} +1 -1
- package/web/_astro/{diagram-5GNKFQAL.C9HxUUMl.js → diagram-5GNKFQAL.IzZpuM-Y.js} +1 -1
- package/web/_astro/{diagram-KO2AKTUF.4ywkQN3t.js → diagram-KO2AKTUF.DPTF_fgv.js} +1 -1
- package/web/_astro/{diagram-LMA3HP47.C48A6gpz.js → diagram-LMA3HP47.CCyza39P.js} +1 -1
- package/web/_astro/{diagram-OG6HWLK6.DxFieQW4.js → diagram-OG6HWLK6.BXAi8zcZ.js} +1 -1
- package/web/_astro/{erDiagram-TEJ5UH35.CtjtQqYs.js → erDiagram-TEJ5UH35.DUDX7_MR.js} +1 -1
- package/web/_astro/{flowDiagram-I6XJVG4X.C5zAiahU.js → flowDiagram-I6XJVG4X.C63QTh3N.js} +1 -1
- package/web/_astro/{ganttDiagram-6RSMTGT7.D_L6zsny.js → ganttDiagram-6RSMTGT7.CnlZJSwG.js} +1 -1
- package/web/_astro/{gitGraphDiagram-PVQCEYII.Ignnrk3V.js → gitGraphDiagram-PVQCEYII.CTqIrOPC.js} +1 -1
- package/web/_astro/{infoDiagram-5YYISTIA.DLv8-P5u.js → infoDiagram-5YYISTIA.BYMiDFh9.js} +1 -1
- package/web/_astro/{ishikawaDiagram-YF4QCWOH.p0OTpwFO.js → ishikawaDiagram-YF4QCWOH.CRiQmI-z.js} +1 -1
- package/web/_astro/{journeyDiagram-JHISSGLW.CIaBt-DD.js → journeyDiagram-JHISSGLW.YQgWBsEU.js} +1 -1
- package/web/_astro/{kanban-definition-UN3LZRKU.DGySIntq.js → kanban-definition-UN3LZRKU.1ECnrrK1.js} +1 -1
- package/web/_astro/{linear.BATV4RXu.js → linear.DzVA71yT.js} +1 -1
- package/web/_astro/{mermaid.core.DzkwM3VX.js → mermaid.core.BK7P2Sr_.js} +4 -4
- package/web/_astro/{mindmap-definition-RKZ34NQL.3piBRRzA.js → mindmap-definition-RKZ34NQL.BvXyWZK7.js} +1 -1
- package/web/_astro/{pieDiagram-4H26LBE5.DUNueLub.js → pieDiagram-4H26LBE5.BiXk1TW3.js} +1 -1
- package/web/_astro/{quadrantDiagram-W4KKPZXB.9bihVbrt.js → quadrantDiagram-W4KKPZXB.krvBH8lh.js} +1 -1
- package/web/_astro/{requirementDiagram-4Y6WPE33.CkjsC-YT.js → requirementDiagram-4Y6WPE33.ih1gL25c.js} +1 -1
- package/web/_astro/{sankeyDiagram-5OEKKPKP.Dbq4vaoQ.js → sankeyDiagram-5OEKKPKP.CpUxkv4u.js} +1 -1
- package/web/_astro/{sequenceDiagram-3UESZ5HK.BivrH99P.js → sequenceDiagram-3UESZ5HK.clAfeN7y.js} +1 -1
- package/web/_astro/{stateDiagram-AJRCARHV.CqLQ1Vzz.js → stateDiagram-AJRCARHV.DpXWb8-m.js} +1 -1
- package/web/_astro/{stateDiagram-v2-BHNVJYJU.DvvoLD3b.js → stateDiagram-v2-BHNVJYJU.ClZb9GIH.js} +1 -1
- package/web/_astro/{timeline-definition-PNZ67QCA.B-KR78gv.js → timeline-definition-PNZ67QCA.BLcX5dh7.js} +1 -1
- package/web/_astro/{vennDiagram-CIIHVFJN.Ck0Eieb5.js → vennDiagram-CIIHVFJN.oGgpKMpx.js} +1 -1
- package/web/_astro/{wardleyDiagram-YWT4CUSO.CRfdd_do.js → wardleyDiagram-YWT4CUSO.BPHtMtt-.js} +1 -1
- package/web/_astro/{xychartDiagram-2RQKCTM6.Ck_Jxk9C.js → xychartDiagram-2RQKCTM6.BNZOPYSk.js} +1 -1
- package/web/index.html +1 -1
- package/web/_astro/channel.BKCmJpWM.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/mermaid.core.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["_astro/mermaid.core.BK7P2Sr_.js","_astro/_commonjsHelpers.CqkleIqs.js","_astro/TaskDetail.CK7oXddP.js","_astro/jsx-runtime.DWOiEOII.js","_astro/index.5dn-Zm-2.js","_astro/index.tZfqwSut.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{j as a}from"./jsx-runtime.DWOiEOII.js";import{r as g,R as Ve}from"./index.5dn-Zm-2.js";import{aQ as ap,aC as Pi,aF as ip,N as C1,O as zA,e as mo,a2 as HA,i as GA}from"./chunk-JMJ3UQ3L.BQJEJHu4.js";import{g as zl}from"./_commonjsHelpers.CqkleIqs.js";import{r as Or}from"./index.Cyc_GA4f.js";function WA(e){return e[0]??{}}function ul(e){return Array.isArray(e)?e:e==null?[]:[e]}const Cx="orpc",qA="@orpc/shared",VA="1.14.4";class YA extends Error{constructor(...t){super(...t),this.name="AbortError"}}function KA(e){let t;return()=>{if(t)return t.result;const n=e();return t={result:n},n}}function ZA(e){let t=Promise.resolve();return(...n)=>t=t.catch(()=>{}).then(()=>e(...n))}const XA=2,QA=`__${qA}@${VA}/otel/config__`;function Hl(){return globalThis[QA]}function op(e,t={},n){return Hl()?.tracer?.startSpan(e,t,n)}function ss(e,t,n={}){if(!e)return;const r=JA(t);e.recordException(r),(!n.signal?.aborted||n.signal.reason!==t)&&e.setStatus({code:XA,message:r.message})}function JA(e){if(e instanceof Error){const t={message:e.message,name:e.name,stack:e.stack};return"code"in e&&(typeof e.code=="string"||typeof e.code=="number")&&(t.code=e.code),t}return{message:String(e)}}async function qa({name:e,context:t,...n},r){const s=Hl()?.tracer;if(!s)return r();const i=async o=>{try{return await r(o)}catch(l){throw ss(o,l,n),l}finally{o.end()}};return t?s.startActiveSpan(e,n,t,i):s.startActiveSpan(e,n,i)}async function ea(e,t){const n=Hl();if(!e||!n)return t();const r=n.trace.setSpan(n.context.active(),e);return n.context.with(r,t)}function bi(e){return!e||typeof e!="object"?!1:"next"in e&&typeof e.next=="function"&&Symbol.asyncIterator in e&&typeof e[Symbol.asyncIterator]=="function"}const ek=Symbol.for("asyncDispose"),tk=Symbol.asyncDispose??ek;class lp{#e=!1;#t=!1;#n;#r;constructor(t,n){this.#n=n,this.#r=ZA(async()=>{if(this.#e)return{done:!0,value:void 0};try{const r=await t();return r.done&&(this.#e=!0),r}catch(r){throw this.#e=!0,r}finally{this.#e&&!this.#t&&(this.#t=!0,await this.#n("next"))}})}next(){return this.#r()}async return(t){return this.#e=!0,this.#t||(this.#t=!0,await this.#n("return")),{done:!0,value:t}}async throw(t){throw this.#e=!0,this.#t||(this.#t=!0,await this.#n("throw")),t}async[tk](){this.#e=!0,this.#t||(this.#t=!0,await this.#n("dispose"))}[Symbol.asyncIterator](){return this}}function Ix({name:e,...t},n){let r;return new lp(async()=>{r??=op(e);try{const s=await ea(r,()=>n.next());return r?.addEvent(s.done?"completed":"yielded"),s}catch(s){throw ss(r,s,t),s}},async s=>{try{s!=="next"&&await ea(r,()=>n.return?.())}catch(i){throw ss(r,i,t),i}finally{r?.end()}})}function nk(e){return async(t,...n)=>{try{return await t.next()}catch(r){throw await e(r,t,...n),r}}}function od(e,t,n){const r=(s,i)=>{const o=e[i];return o?o({...s,next:(l=s)=>r(l,i+1)}):n(s)};return r(t,0)}function Zo(e){if(e)return JSON.parse(e)}function ld(e){return JSON.stringify(e)}function rk(e){return as(e)?Object.getPrototypeOf(e)?.constructor:null}function Lr(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||!t||!t.constructor}function as(e){return!!e&&(typeof e=="object"||typeof e=="function")}function Rx(e,t){let n=e;for(const r of t){if(!as(n))return;n=n[r]}return n}const I1=(()=>{const e=function(){};return e.prototype=Object.create(null),Object.freeze(e.prototype),e})();function Dx(e,...t){return typeof e=="function"?e(...t):e}function R1(e){return new Proxy(e,{get(t,n,r){const s=Reflect.get(t,n,r);return n!=="then"||typeof s!="function"?s:new Proxy(s,{apply(i,o,l){if(l.length!==2||l.some(c=>!ak(c)))return Reflect.apply(i,o,l);let u=!0;l[0].call(o,R1(new Proxy(t,{get:(c,d,p)=>{if(u&&d==="then"){u=!1;return}return Reflect.get(c,d,p)}})))}})}})}const sk=/^\s*function\s*\(\)\s*\{\s*\[native code\]\s*\}\s*$/;function ak(e){return typeof e=="function"&&sk.test(e.toString())}function ik(e){try{return decodeURIComponent(e)}catch{return e}}const ok="@orpc/client",lk="1.14.4",up={BAD_REQUEST:{status:400,message:"Bad Request"},UNAUTHORIZED:{status:401,message:"Unauthorized"},FORBIDDEN:{status:403,message:"Forbidden"},NOT_FOUND:{status:404,message:"Not Found"},METHOD_NOT_SUPPORTED:{status:405,message:"Method Not Supported"},NOT_ACCEPTABLE:{status:406,message:"Not Acceptable"},TIMEOUT:{status:408,message:"Request Timeout"},CONFLICT:{status:409,message:"Conflict"},PRECONDITION_FAILED:{status:412,message:"Precondition Failed"},PAYLOAD_TOO_LARGE:{status:413,message:"Payload Too Large"},UNSUPPORTED_MEDIA_TYPE:{status:415,message:"Unsupported Media Type"},UNPROCESSABLE_CONTENT:{status:422,message:"Unprocessable Content"},TOO_MANY_REQUESTS:{status:429,message:"Too Many Requests"},CLIENT_CLOSED_REQUEST:{status:499,message:"Client Closed Request"},INTERNAL_SERVER_ERROR:{status:500,message:"Internal Server Error"},NOT_IMPLEMENTED:{status:501,message:"Not Implemented"},BAD_GATEWAY:{status:502,message:"Bad Gateway"},SERVICE_UNAVAILABLE:{status:503,message:"Service Unavailable"},GATEWAY_TIMEOUT:{status:504,message:"Gateway Timeout"}};function uk(e,t){return t??up[e]?.status??500}function ck(e,t){return t||up[e]?.message||e}const D1=Symbol.for(`__${ok}@${lk}/error/ORPC_ERROR_CONSTRUCTORS__`);globalThis[D1]??=new WeakSet;const ud=globalThis[D1];class xi extends Error{defined;code;status;data;constructor(t,...n){const r=WA(n);if(r.status!==void 0&&!yi(r.status))throw new Error("[ORPCError] Invalid error status code.");const s=ck(t,r.message);super(s,r),this.code=t,this.status=uk(t,r.status),this.defined=r.defined??!1,this.data=r.data}toJSON(){return{defined:this.defined,code:this.code,status:this.status,message:this.message,data:this.data}}static[Symbol.hasInstance](t){if(ud.has(this)){const n=rk(t);if(n&&ud.has(n))return!0}return super[Symbol.hasInstance](t)}}ud.add(xi);function dk(e){return e instanceof xi?e:new xi("INTERNAL_SERVER_ERROR",{message:"Internal server error",cause:e})}function yi(e){return e<200||e>=400}function O1(e){if(!Lr(e))return!1;const t=["defined","code","status","message","data"];return Object.keys(e).some(n=>!t.includes(n))?!1:"defined"in e&&typeof e.defined=="boolean"&&"code"in e&&typeof e.code=="string"&&"status"in e&&typeof e.status=="number"&&yi(e.status)&&"message"in e&&typeof e.message=="string"}function L1(e,t={}){return new xi(e.code,{...t,...e})}class Gl extends TypeError{}class pk extends TypeError{}class Ei extends Error{data;constructor(t){super(t?.message??"An error event was received",t),this.data=t?.data}}function fk(e){const t=e.replace(/\n+$/,"").split(/\n/),n={data:void 0,event:void 0,id:void 0,retry:void 0,comments:[]};for(const r of t){const s=r.indexOf(":"),i=s===-1?r:r.slice(0,s),o=s===-1?"":r.slice(s+1).replace(/^\s/,"");if(s===0)n.comments.push(o);else if(i==="data")n.data??="",n.data+=`${o}
|
|
3
3
|
`;else if(i==="event")n.event=o;else if(i==="id")n.id=o;else if(i==="retry"){const l=Number.parseInt(o);Number.isInteger(l)&&l>=0&&l.toString()===o&&(n.retry=l)}}return n.data=n.data?.replace(/\n$/,""),n}class mk{constructor(t={}){this.options=t}incomplete="";feed(t){this.incomplete+=t;const n=this.incomplete.lastIndexOf(`
|
|
4
4
|
|
|
@@ -76,7 +76,7 @@ import{j as a}from"./jsx-runtime.DWOiEOII.js";import{r as g,R as Ve}from"./index
|
|
|
76
76
|
|
|
77
77
|
`)}m.write("payload.value = newResult;"),m.write("return payload;");const v=m.compile();return(S,A)=>v(f,S,A)};let i;const o=Si,l=!dp.jitless,c=l&&zk.value,d=t.catchall;let p;e._zod.parse=(f,m)=>{p??(p=r.value);const b=f.value;return o(b)?l&&c&&m?.async===!1&&m.jitless!==!0?(i||(i=s(t.shape)),f=i(f,m),d?oS([],b,f,m,p,e):f):n(f,m):(f.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),f)}});function $x(e,t,n,r){for(const i of e)if(i.issues.length===0)return t.value=i.value,t;const s=e.filter(i=>!Ms(i));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(i=>i.issues.map(o=>Sr(o,r,Er())))}),t)}const lS=ae("$ZodUnion",(e,t)=>{It.init(e,t),xt(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),xt(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),xt(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),xt(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${r.map(s=>fp(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,s)=>{if(n)return n(r,s);let i=!1;const o=[];for(const l of t.options){const u=l._zod.run({value:r.value,issues:[]},s);if(u instanceof Promise)o.push(u),i=!0;else{if(u.issues.length===0)return u;o.push(u)}}return i?Promise.all(o).then(l=>$x(l,r,e,s)):$x(o,r,e,s)}}),DC=ae("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,lS.init(e,t);const n=e._zod.parse;xt(e._zod,"propValues",()=>{const s={};for(const i of t.options){const o=i._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const[l,u]of Object.entries(o)){s[l]||(s[l]=new Set);for(const c of u)s[l].add(c)}}return s});const r=Wl(()=>{const s=t.options,i=new Map;for(const o of s){const l=o._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const u of l){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,o)}}return i});e._zod.parse=(s,i)=>{const o=s.value;if(!Si(o))return s.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),s;const l=r.value.get(o?.[t.discriminator]);return l?l._zod.run(s,i):t.unionFallback||i.direction==="backward"?n(s,i):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),s)}}),OC=ae("$ZodIntersection",(e,t)=>{It.init(e,t),e._zod.parse=(n,r)=>{const s=n.value,i=t.left._zod.run({value:s,issues:[]},r),o=t.right._zod.run({value:s,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([u,c])=>zx(n,u,c)):zx(n,i,o)}});function pd(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ta(e)&&ta(t)){const n=Object.keys(t),r=Object.keys(e).filter(i=>n.indexOf(i)!==-1),s={...e,...t};for(const i of r){const o=pd(e[i],t[i]);if(!o.valid)return{valid:!1,mergeErrorPath:[i,...o.mergeErrorPath]};s[i]=o.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const s=e[r],i=t[r],o=pd(s,i);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function zx(e,t,n){const r=new Map;let s;for(const l of t.issues)if(l.code==="unrecognized_keys"){s??(s=l);for(const u of l.keys)r.has(u)||r.set(u,{}),r.get(u).l=!0}else e.issues.push(l);for(const l of n.issues)if(l.code==="unrecognized_keys")for(const u of l.keys)r.has(u)||r.set(u,{}),r.get(u).r=!0;else e.issues.push(l);const i=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(i.length&&s&&e.issues.push({...s,keys:i}),Ms(e))return e;const o=pd(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const LC=ae("$ZodRecord",(e,t)=>{It.init(e,t),e._zod.parse=(n,r)=>{const s=n.value;if(!ta(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const i=[],o=t.keyType._zod.values;if(o){n.value={};const l=new Set;for(const c of o)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){l.add(typeof c=="number"?c.toString():c);const d=t.keyType._zod.run({value:c,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(m=>Sr(m,r,Er())),input:c,path:[c],inst:e});continue}const p=d.value,f=t.valueType._zod.run({value:s[c],issues:[]},r);f instanceof Promise?i.push(f.then(m=>{m.issues.length&&n.issues.push(...Fs(c,m.issues)),n.value[p]=m.value})):(f.issues.length&&n.issues.push(...Fs(c,f.issues)),n.value[p]=f.value)}let u;for(const c in s)l.has(c)||(u=u??[],u.push(c));u&&u.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u})}else{n.value={};for(const l of Reflect.ownKeys(s)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,l))continue;let u=t.keyType._zod.run({value:l,issues:[]},r);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&eS.test(l)&&u.issues.length){const p=t.keyType._zod.run({value:Number(l),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(u=p)}if(u.issues.length){t.mode==="loose"?n.value[l]=s[l]:n.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(p=>Sr(p,r,Er())),input:l,path:[l],inst:e});continue}const d=t.valueType._zod.run({value:s[l],issues:[]},r);d instanceof Promise?i.push(d.then(p=>{p.issues.length&&n.issues.push(...Fs(l,p.issues)),n.value[u.value]=p.value})):(d.issues.length&&n.issues.push(...Fs(l,d.issues)),n.value[u.value]=d.value)}}return i.length?Promise.all(i).then(()=>n):n}}),jC=ae("$ZodEnum",(e,t)=>{It.init(e,t);const n=W1(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(s=>Hk.has(typeof s)).map(s=>typeof s=="string"?na(s):s.toString()).join("|")})$`),e._zod.parse=(s,i)=>{const o=s.value;return r.has(o)||s.issues.push({code:"invalid_value",values:n,input:o,inst:e}),s}}),MC=ae("$ZodLiteral",(e,t)=>{if(It.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?na(r):r?na(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,s)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),FC=ae("$ZodTransform",(e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new G1(e.constructor.name);const s=t.transform(n.value,n);if(r.async)return(s instanceof Promise?s:Promise.resolve(s)).then(o=>(n.value=o,n.fallback=!0,n));if(s instanceof Promise)throw new Vs;return n.value=s,n.fallback=!0,n}});function Hx(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const uS=ae("$ZodOptional",(e,t)=>{It.init(e,t),e._zod.optin="optional",e._zod.optout="optional",xt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),xt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fp(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(o=>Hx(o,s)):Hx(i,s)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),PC=ae("$ZodExactOptional",(e,t)=>{uS.init(e,t),xt(e._zod,"values",()=>t.innerType._zod.values),xt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),BC=ae("$ZodNullable",(e,t)=>{It.init(e,t),xt(e._zod,"optin",()=>t.innerType._zod.optin),xt(e._zod,"optout",()=>t.innerType._zod.optout),xt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${fp(n.source)}|null)$`):void 0}),xt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),UC=ae("$ZodDefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Gx(i,t)):Gx(s,t)}});function Gx(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const $C=ae("$ZodPrefault",(e,t)=>{It.init(e,t),e._zod.optin="optional",xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),zC=ae("$ZodNonOptional",(e,t)=>{It.init(e,t),xt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>Wx(i,e)):Wx(s,e)}});function Wx(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const HC=ae("$ZodCatch",(e,t)=>{It.init(e,t),e._zod.optin="optional",xt(e._zod,"optout",()=>t.innerType._zod.optout),xt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(i=>(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(o=>Sr(o,r,Er()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(i=>Sr(i,r,Er()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),cS=ae("$ZodPipe",(e,t)=>{It.init(e,t),xt(e._zod,"values",()=>t.in._zod.values),xt(e._zod,"optin",()=>t.in._zod.optin),xt(e._zod,"optout",()=>t.out._zod.optout),xt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const i=t.out._zod.run(n,r);return i instanceof Promise?i.then(o=>xo(o,t.in,r)):xo(i,t.in,r)}const s=t.in._zod.run(n,r);return s instanceof Promise?s.then(i=>xo(i,t.out,r)):xo(s,t.out,r)}});function xo(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const GC=ae("$ZodPreprocess",(e,t)=>{cS.init(e,t)}),WC=ae("$ZodReadonly",(e,t)=>{It.init(e,t),xt(e._zod,"propValues",()=>t.innerType._zod.propValues),xt(e._zod,"values",()=>t.innerType._zod.values),xt(e._zod,"optin",()=>t.innerType?._zod?.optin),xt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(qx):qx(s)}});function qx(e){return e.value=Object.freeze(e.value),e}const qC=ae("$ZodCustom",(e,t)=>{An.init(e,t),It.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,s=t.fn(r);if(s instanceof Promise)return s.then(i=>Vx(i,n,r,e));Vx(s,n,r,e)}});function Vx(e,t,n,r){if(!e){const s={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(s.params=r._zod.def.params),t.issues.push(Ti(s))}}var Yx;class VC{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const s={...r,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function YC(){return new VC}(Yx=globalThis).__zod_globalRegistry??(Yx.__zod_globalRegistry=YC());const Va=globalThis.__zod_globalRegistry;function KC(e,t){return new e({type:"string",...Le(t)})}function ZC(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Le(t)})}function Kx(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Le(t)})}function XC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Le(t)})}function QC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Le(t)})}function JC(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Le(t)})}function e2(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Le(t)})}function t2(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Le(t)})}function n2(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Le(t)})}function r2(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Le(t)})}function s2(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Le(t)})}function a2(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Le(t)})}function i2(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Le(t)})}function o2(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Le(t)})}function l2(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Le(t)})}function u2(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Le(t)})}function c2(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Le(t)})}function d2(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Le(t)})}function p2(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Le(t)})}function f2(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Le(t)})}function m2(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Le(t)})}function h2(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Le(t)})}function g2(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Le(t)})}function b2(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Le(t)})}function x2(e,t){return new e({type:"string",format:"date",check:"string_format",...Le(t)})}function y2(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Le(t)})}function E2(e,t){return new e({type:"string",format:"duration",check:"string_format",...Le(t)})}function S2(e,t){return new e({type:"number",checks:[],...Le(t)})}function T2(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Le(t)})}function N2(e,t){return new e({type:"boolean",...Le(t)})}function w2(e,t){return new e({type:"null",...Le(t)})}function v2(e){return new e({type:"unknown"})}function A2(e,t){return new e({type:"never",...Le(t)})}function Zx(e,t){return new nS({check:"less_than",...Le(t),value:e,inclusive:!1})}function Xu(e,t){return new nS({check:"less_than",...Le(t),value:e,inclusive:!0})}function Xx(e,t){return new rS({check:"greater_than",...Le(t),value:e,inclusive:!1})}function Qu(e,t){return new rS({check:"greater_than",...Le(t),value:e,inclusive:!0})}function Qx(e,t){return new B_({check:"multiple_of",...Le(t),value:e})}function dS(e,t){return new $_({check:"max_length",...Le(t),maximum:e})}function pl(e,t){return new z_({check:"min_length",...Le(t),minimum:e})}function pS(e,t){return new H_({check:"length_equals",...Le(t),length:e})}function k2(e,t){return new G_({check:"string_format",format:"regex",...Le(t),pattern:e})}function _2(e){return new W_({check:"string_format",format:"lowercase",...Le(e)})}function C2(e){return new q_({check:"string_format",format:"uppercase",...Le(e)})}function I2(e,t){return new V_({check:"string_format",format:"includes",...Le(t),includes:e})}function R2(e,t){return new Y_({check:"string_format",format:"starts_with",...Le(t),prefix:e})}function D2(e,t){return new K_({check:"string_format",format:"ends_with",...Le(t),suffix:e})}function ca(e){return new Z_({check:"overwrite",tx:e})}function O2(e){return ca(t=>t.normalize(e))}function L2(){return ca(e=>e.trim())}function j2(){return ca(e=>e.toLowerCase())}function M2(){return ca(e=>e.toUpperCase())}function F2(){return ca(e=>$k(e))}function P2(e,t,n){return new e({type:"array",element:t,...Le(n)})}function B2(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Le(n)})}function U2(e,t){const n=$2(r=>(r.addIssue=s=>{if(typeof s=="string")r.issues.push(Ti(s,r.value,n._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),r.issues.push(Ti(i))}},e(r.value,r)),t);return n}function $2(e,t){const n=new An({check:"custom",...Le(t)});return n._zod.check=e,n}function fS(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??Va,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function qt(e,t,n={path:[],schemaPath:[]}){var r;const s=e._zod.def,i=t.seen.get(e);if(i)return i.count++,n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const l=e._zod.toJSONSchema?.();if(l)o.schema=l;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,d);else{const f=o.schema,m=t.processors[s.type];if(!m)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);m(e,t,f,d)}const p=e._zod.parent;p&&(o.ref||(o.ref=p),qt(p,t,d),t.seen.get(p).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(o.schema,u),t.io==="input"&&gn(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function mS(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const l=e.metadataRegistry.get(o[0])?.id;if(l){const u=r.get(l);if(u&&u!==o[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,o[0])}}const s=o=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const p=e.external.registry.get(o[0])?.id,f=e.external.uri??(b=>b);if(p)return{ref:f(p)};const m=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=m,{defId:m,ref:`${f("__shared")}#/${l}/${m}`}}if(o[1]===n)return{ref:"#"};const c=`#/${l}/`,d=o[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:c+d}},i=o=>{if(o[1].schema.$ref)return;const l=o[1],{ref:u,defId:c}=s(o);l.def={...l.schema},c&&(l.defId=c);const d=l.schema;for(const p in d)delete d[p];d.$ref=u};if(e.cycles==="throw")for(const o of e.seen.entries()){const l=o[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>
|
|
78
78
|
|
|
79
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const l=o[1];if(t===o[0]){i(o);continue}if(e.external){const c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(l.cycle){i(o);continue}if(l.count>1&&e.reused==="ref"){i(o);continue}}}function hS(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const u=e.seen.get(l);if(u.ref===null)return;const c=u.def??u.schema,d={...c},p=u.ref;if(u.ref=null,p){r(p);const m=e.seen.get(p),b=m.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(b)):Object.assign(c,b),Object.assign(c,d),l._zod.parent===p)for(const y in c)y==="$ref"||y==="allOf"||y in d||delete c[y];if(b.$ref&&m.def)for(const y in c)y==="$ref"||y==="allOf"||y in m.def&&JSON.stringify(c[y])===JSON.stringify(m.def[y])&&delete c[y]}const f=l._zod.parent;if(f&&f!==p){r(f);const m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(const b in c)b==="$ref"||b==="allOf"||b in m.def&&JSON.stringify(c[b])===JSON.stringify(m.def[b])&&delete c[b]}e.override({zodSchema:l,jsonSchema:c,path:u.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&s.id===i&&delete s.id;const o=e.external?.defs??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,o[u.defId]=u.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:fl(t,"input",e.processors),output:fl(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return gn(r.element,n);if(r.type==="set")return gn(r.valueType,n);if(r.type==="lazy")return gn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return gn(r.innerType,n);if(r.type==="intersection")return gn(r.left,n)||gn(r.right,n);if(r.type==="record"||r.type==="map")return gn(r.keyType,n)||gn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gn(r.in,n)||gn(r.out,n);if(r.type==="object"){for(const s in r.shape)if(gn(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(gn(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(gn(s,n))return!0;return!!(r.rest&&gn(r.rest,n))}return!1}const z2=(e,t={})=>n=>{const r=fS({...n,processors:t});return qt(e,r),mS(r,e),hS(r,e)},fl=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=fS({...s??{},target:i,io:t,processors:n});return qt(e,o),mS(o,e),hS(o,e)},H2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},G2=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:l,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),l&&(s.format=H2[l]??l,s.format===""&&delete s.format,l==="time"&&delete s.format),c&&(s.contentEncoding=c),u&&u.size>0){const d=[...u];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},W2=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:l,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof l=="string"&&l.includes("int")?s.type="integer":s.type="number";const p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";p?m?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),f?m?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),typeof u=="number"&&(s.multipleOf=u)},q2=(e,t,n,r)=>{n.type="boolean"},V2=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Y2=(e,t,n,r)=>{n.not={}},K2=(e,t,n,r)=>{},Z2=(e,t,n,r)=>{const s=e._zod.def,i=W1(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},X2=(e,t,n,r)=>{const s=e._zod.def,i=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},Q2=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},J2=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},eI=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:l}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=qt(i.element,t,{...r,path:[...r.path,"items"]})},tI=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const c in o)s.properties[c]=qt(o[c],t,{...r,path:[...r.path,"properties",c]});const l=new Set(Object.keys(o)),u=new Set([...l].filter(c=>{const d=i.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(s.required=Array.from(u)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=qt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},nI=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((l,u)=>qt(l,t,{...r,path:[...r.path,i?"oneOf":"anyOf",u]}));i?n.oneOf=o:n.anyOf=o},rI=(e,t,n,r)=>{const s=e._zod.def,i=qt(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=qt(s.right,t,{...r,path:[...r.path,"allOf",1]}),l=c=>"allOf"in c&&Object.keys(c).length===1,u=[...l(i)?i.allOf:[i],...l(o)?o.allOf:[o]];n.allOf=u},sI=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,u=o._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){const d=qt(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of u)s.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=qt(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=qt(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=o._zod.values;if(c){const d=[...c].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d)}},aI=(e,t,n,r)=>{const s=e._zod.def,i=qt(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},iI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},oI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},lI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},uI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},cI=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?i?s.out:s.in:s.out;qt(o,t,r);const l=t.seen.get(e);l.ref=o},dI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},gS=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},pI=ae("ZodISODateTime",(e,t)=>{cC.init(e,t),jt.init(e,t)});function fI(e){return b2(pI,e)}const mI=ae("ZodISODate",(e,t)=>{dC.init(e,t),jt.init(e,t)});function hI(e){return x2(mI,e)}const gI=ae("ZodISOTime",(e,t)=>{pC.init(e,t),jt.init(e,t)});function bI(e){return y2(gI,e)}const xI=ae("ZodISODuration",(e,t)=>{fC.init(e,t),jt.init(e,t)});function yI(e){return E2(xI,e)}const EI=(e,t)=>{K1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>t_(e,n)},flatten:{value:n=>e_(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,dd,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,dd,2)}},isEmpty:{get(){return e.issues.length===0}}})},$n=ae("ZodError",EI,{Parent:Error}),SI=hp($n),TI=gp($n),NI=ql($n),wI=Vl($n),vI=s_($n),AI=a_($n),kI=i_($n),_I=o_($n),CI=l_($n),II=u_($n),RI=c_($n),DI=d_($n),Jx=new WeakMap;function Bi(e,t,n){const r=Object.getPrototypeOf(e);let s=Jx.get(r);if(s||(s=new Set,Jx.set(r,s)),!s.has(t)){s.add(t);for(const i in n){const o=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){const l=o.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}const Dt=ae("ZodType",(e,t)=>(It.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:fl(e,"input"),output:fl(e,"output")}}),e.toJSONSchema=z2(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>SI(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>NI(e,n,r),e.parseAsync=async(n,r)=>TI(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>wI(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>vI(e,n,r),e.decode=(n,r)=>AI(e,n,r),e.encodeAsync=async(n,r)=>kI(e,n,r),e.decodeAsync=async(n,r)=>_I(e,n,r),e.safeEncode=(n,r)=>CI(e,n,r),e.safeDecode=(n,r)=>II(e,n,r),e.safeEncodeAsync=async(n,r)=>RI(e,n,r),e.safeDecodeAsync=async(n,r)=>DI(e,n,r),Bi(e,"ZodType",{check(...n){const r=this.def;return this.clone(Ur(r,{checks:[...r.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return $r(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(vR(n,r))},superRefine(n,r){return this.check(AR(n,r))},overwrite(n){return this.check(ca(n))},optional(){return r0(this)},exactOptional(){return pR(this)},nullable(){return s0(this)},nullish(){return r0(s0(this))},nonoptional(n){return xR(this,n)},array(){return ke(this)},or(n){return iR([this,n])},and(n){return ES(this,n)},transform(n){return a0(this,SS(n))},default(n){return hR(this,n)},prefault(n){return bR(this,n)},catch(n){return ER(this,n)},pipe(n){return a0(this,n)},readonly(){return NR(this)},describe(n){const r=this.clone();return Va.add(r,{description:n}),r},meta(...n){if(n.length===0)return Va.get(this);const r=this.clone();return Va.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Va.get(e)?.description},configurable:!0}),e)),bS=ae("_ZodString",(e,t)=>{bp.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(r,s,i)=>G2(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Bi(e,"_ZodString",{regex(...r){return this.check(k2(...r))},includes(...r){return this.check(I2(...r))},startsWith(...r){return this.check(R2(...r))},endsWith(...r){return this.check(D2(...r))},min(...r){return this.check(pl(...r))},max(...r){return this.check(dS(...r))},length(...r){return this.check(pS(...r))},nonempty(...r){return this.check(pl(1,...r))},lowercase(r){return this.check(_2(r))},uppercase(r){return this.check(C2(r))},trim(){return this.check(L2())},normalize(...r){return this.check(O2(...r))},toLowerCase(){return this.check(j2())},toUpperCase(){return this.check(M2())},slugify(){return this.check(F2())}})}),OI=ae("ZodString",(e,t)=>{bp.init(e,t),bS.init(e,t),e.email=n=>e.check(ZC(LI,n)),e.url=n=>e.check(t2(jI,n)),e.jwt=n=>e.check(g2(ZI,n)),e.emoji=n=>e.check(n2(MI,n)),e.guid=n=>e.check(Kx(e0,n)),e.uuid=n=>e.check(XC(yo,n)),e.uuidv4=n=>e.check(QC(yo,n)),e.uuidv6=n=>e.check(JC(yo,n)),e.uuidv7=n=>e.check(e2(yo,n)),e.nanoid=n=>e.check(r2(FI,n)),e.guid=n=>e.check(Kx(e0,n)),e.cuid=n=>e.check(s2(PI,n)),e.cuid2=n=>e.check(a2(BI,n)),e.ulid=n=>e.check(i2(UI,n)),e.base64=n=>e.check(f2(VI,n)),e.base64url=n=>e.check(m2(YI,n)),e.xid=n=>e.check(o2($I,n)),e.ksuid=n=>e.check(l2(zI,n)),e.ipv4=n=>e.check(u2(HI,n)),e.ipv6=n=>e.check(c2(GI,n)),e.cidrv4=n=>e.check(d2(WI,n)),e.cidrv6=n=>e.check(p2(qI,n)),e.e164=n=>e.check(h2(KI,n)),e.datetime=n=>e.check(fI(n)),e.date=n=>e.check(hI(n)),e.time=n=>e.check(bI(n)),e.duration=n=>e.check(yI(n))});function R(e){return KC(OI,e)}const jt=ae("ZodStringFormat",(e,t)=>{Rt.init(e,t),bS.init(e,t)}),LI=ae("ZodEmail",(e,t)=>{tC.init(e,t),jt.init(e,t)}),e0=ae("ZodGUID",(e,t)=>{J_.init(e,t),jt.init(e,t)}),yo=ae("ZodUUID",(e,t)=>{eC.init(e,t),jt.init(e,t)}),jI=ae("ZodURL",(e,t)=>{nC.init(e,t),jt.init(e,t)}),MI=ae("ZodEmoji",(e,t)=>{rC.init(e,t),jt.init(e,t)}),FI=ae("ZodNanoID",(e,t)=>{sC.init(e,t),jt.init(e,t)}),PI=ae("ZodCUID",(e,t)=>{aC.init(e,t),jt.init(e,t)}),BI=ae("ZodCUID2",(e,t)=>{iC.init(e,t),jt.init(e,t)}),UI=ae("ZodULID",(e,t)=>{oC.init(e,t),jt.init(e,t)}),$I=ae("ZodXID",(e,t)=>{lC.init(e,t),jt.init(e,t)}),zI=ae("ZodKSUID",(e,t)=>{uC.init(e,t),jt.init(e,t)}),HI=ae("ZodIPv4",(e,t)=>{mC.init(e,t),jt.init(e,t)}),GI=ae("ZodIPv6",(e,t)=>{hC.init(e,t),jt.init(e,t)}),WI=ae("ZodCIDRv4",(e,t)=>{gC.init(e,t),jt.init(e,t)}),qI=ae("ZodCIDRv6",(e,t)=>{bC.init(e,t),jt.init(e,t)}),VI=ae("ZodBase64",(e,t)=>{xC.init(e,t),jt.init(e,t)}),YI=ae("ZodBase64URL",(e,t)=>{EC.init(e,t),jt.init(e,t)}),KI=ae("ZodE164",(e,t)=>{SC.init(e,t),jt.init(e,t)}),ZI=ae("ZodJWT",(e,t)=>{NC.init(e,t),jt.init(e,t)}),xS=ae("ZodNumber",(e,t)=>{aS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(r,s,i)=>W2(e,r,s),Bi(e,"ZodNumber",{gt(r,s){return this.check(Xx(r,s))},gte(r,s){return this.check(Qu(r,s))},min(r,s){return this.check(Qu(r,s))},lt(r,s){return this.check(Zx(r,s))},lte(r,s){return this.check(Xu(r,s))},max(r,s){return this.check(Xu(r,s))},int(r){return this.check(t0(r))},safe(r){return this.check(t0(r))},positive(r){return this.check(Xx(0,r))},nonnegative(r){return this.check(Qu(0,r))},negative(r){return this.check(Zx(0,r))},nonpositive(r){return this.check(Xu(0,r))},multipleOf(r,s){return this.check(Qx(r,s))},step(r,s){return this.check(Qx(r,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function K(e){return S2(xS,e)}const XI=ae("ZodNumberFormat",(e,t)=>{wC.init(e,t),xS.init(e,t)});function t0(e){return T2(XI,e)}const QI=ae("ZodBoolean",(e,t)=>{vC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>q2(e,n,r)});function $t(e){return N2(QI,e)}const JI=ae("ZodNull",(e,t)=>{AC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>V2(e,n,r)});function eR(e){return w2(JI,e)}const tR=ae("ZodUnknown",(e,t)=>{kC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>K2()});function Pr(){return v2(tR)}const nR=ae("ZodNever",(e,t)=>{_C.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Y2(e,n,r)});function rR(e){return A2(nR,e)}const sR=ae("ZodArray",(e,t)=>{CC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eI(e,n,r,s),e.element=t.element,Bi(e,"ZodArray",{min(n,r){return this.check(pl(n,r))},nonempty(n){return this.check(pl(1,n))},max(n,r){return this.check(dS(n,r))},length(n,r){return this.check(pS(n,r))},unwrap(){return this.element}})});function ke(e,t){return P2(sR,e,t)}const aR=ae("ZodObject",(e,t)=>{RC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>tI(e,n,r,s),xt(e,"shape",()=>t.shape),Bi(e,"ZodObject",{keyof(){return Oe(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Pr()})},loose(){return this.clone({...this._zod.def,catchall:Pr()})},strict(){return this.clone({...this._zod.def,catchall:rR()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Yk(this,n)},safeExtend(n){return Kk(this,n)},merge(n){return Zk(this,n)},pick(n){return qk(this,n)},omit(n){return Vk(this,n)},partial(...n){return Xk(TS,this,n[0])},required(...n){return Qk(NS,this,n[0])}})});function se(e,t){const n={type:"object",shape:e??{},...Le(t)};return new aR(n)}const yS=ae("ZodUnion",(e,t)=>{lS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>nI(e,n,r,s),e.options=t.options});function iR(e,t){return new yS({type:"union",options:e,...Le(t)})}const oR=ae("ZodDiscriminatedUnion",(e,t)=>{yS.init(e,t),DC.init(e,t)});function xp(e,t,n){return new oR({type:"union",options:t,discriminator:e,...Le(n)})}const lR=ae("ZodIntersection",(e,t)=>{OC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>rI(e,n,r,s)});function ES(e,t){return new lR({type:"intersection",left:e,right:t})}const n0=ae("ZodRecord",(e,t)=>{LC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>sI(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function zr(e,t,n){return!t||!t._zod?new n0({type:"record",keyType:R(),valueType:e,...Le(t)}):new n0({type:"record",keyType:e,valueType:t,...Le(n)})}const fd=ae("ZodEnum",(e,t)=>{jC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Z2(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new fd({...t,checks:[],...Le(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new fd({...t,checks:[],...Le(s),entries:i})}});function Oe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new fd({type:"enum",entries:n,...Le(t)})}const uR=ae("ZodLiteral",(e,t)=>{MC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>X2(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ln(e,t){return new uR({type:"literal",values:Array.isArray(e)?e:[e],...Le(t)})}const cR=ae("ZodTransform",(e,t)=>{FC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>J2(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new G1(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Ti(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Ti(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function SS(e){return new cR({type:"transform",transform:e})}const TS=ae("ZodOptional",(e,t)=>{uS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gS(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function r0(e){return new TS({type:"optional",innerType:e})}const dR=ae("ZodExactOptional",(e,t)=>{PC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gS(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function pR(e){return new dR({type:"optional",innerType:e})}const fR=ae("ZodNullable",(e,t)=>{BC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>aI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function s0(e){return new fR({type:"nullable",innerType:e})}const mR=ae("ZodDefault",(e,t)=>{UC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>oI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hR(e,t){return new mR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V1(t)}})}const gR=ae("ZodPrefault",(e,t)=>{$C.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>lI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function bR(e,t){return new gR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():V1(t)}})}const NS=ae("ZodNonOptional",(e,t)=>{zC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>iI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function xR(e,t){return new NS({type:"nonoptional",innerType:e,...Le(t)})}const yR=ae("ZodCatch",(e,t)=>{HC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>uI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ER(e,t){return new yR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wS=ae("ZodPipe",(e,t)=>{cS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>cI(e,n,r,s),e.in=t.in,e.out=t.out});function a0(e,t){return new wS({type:"pipe",in:e,out:t})}const SR=ae("ZodPreprocess",(e,t)=>{wS.init(e,t),GC.init(e,t)}),TR=ae("ZodReadonly",(e,t)=>{WC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>dI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function NR(e){return new TR({type:"readonly",innerType:e})}const wR=ae("ZodCustom",(e,t)=>{qC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Q2(e,n)});function vR(e,t={}){return B2(wR,e,t)}function AR(e,t){return U2(e,t)}function Eo(e,t){return new SR({type:"pipe",in:SS(e),out:t})}const kR=se({id:R(),route:R(),retired:ln(!0).optional(),redirectTo:R().optional()}),_R=se({manifestVersion:K(),contributionApiVersion:K(),reactVersion:R(),reactDomVersion:R(),reactRouterVersion:R(),imports:zr(R(),R()),reservedModules:ke(kR)}),CR=xp("type",[se({id:R(),name:R(),icon:R(),type:ln("react"),route:R(),entryUrl:R(),styles:ke(R()),sidebarLabel:R().optional(),description:R().optional(),order:K().optional()}),se({id:R(),name:R(),icon:R(),type:ln("iframe"),route:R(),url:R(),sidebarLabel:R().optional(),description:R().optional(),order:K().optional()})]),IR=se({catalogVersion:ln(1),host:_R.nullable(),modules:ke(CR)}),RR={modules:ot.route({method:"GET",path:"/board/modules",summary:"Read the project Board module catalog",tags:["board"]}).output(IR)},Fn=["backlog","todo","wip","testing","blocked","done","cancelled"],da=["backlog","active","verifying","blocked","done","cancelled"],DR={backlog:"📋",todo:"🔲",wip:"🚧",testing:"🧪",blocked:"🚫",done:"✅",cancelled:"⛔"};function yp(e){try{return DR[AS(e)]??""}catch{return""}}const Kl=["P0","P1","P2","P3"],OR=["simple","standard","complex","research","refine","plan","unit","review","docs"],vS=["task","issue","review","meta","brainstorm"],Zl=["standard","feature-impl","issue","review","meta","brainstorm"],Ep=/^[A-Z][1-9]*$/,LR={completed:"done",complete:"done","in-progress":"wip","in progress":"wip",in_progress:"wip",dropped:"cancelled",cancel:"cancelled",canceled:"cancelled",new:"backlog",pending:"backlog",blocked:"blocked",wip:"wip",testing:"testing",done:"done",cancelled:"cancelled",backlog:"backlog",todo:"todo"};function AS(e){const t=e.trim().toLowerCase(),n=LR[t];if(n===void 0)throw new Error(`Unknown task status: ${JSON.stringify(e)} (allowed: ${Fn.join(", ")})`);return n}const ml=R().min(1).refine(e=>!Number.isNaN(Date.parse(e)),{message:"must be an ISO 8601 timestamp"}),kS=R().regex(Ep,{message:"feature id must match ^[A-Z][1-9]*$ (DD-14)"}).nullable().optional(),_S=R().regex(/^\d{4}$/,{message:"parent_wbs must be a 4-digit WBS string"}).nullable().optional();se({schema_version:ln(1),name:R().min(1),description:R().optional(),status:Eo(e=>{if(typeof e=="string")try{return AS(e)}catch{}return e},Oe(Fn)),type:Oe(vS).optional().default("task"),template:Oe(Zl).optional(),profile:Oe(OR).optional(),feature_id:kS,parent_wbs:_S,priority:Oe(Kl).optional(),tags:ke(R()).optional(),dependencies:ke(R()).optional(),ac_numbering:ln("task-local").optional(),ac_altitude:Oe(["graduating","task-local"]).optional(),done_forced:Eo(e=>typeof e=="string"?e==="true":e,$t().optional()),done_reason:R().optional(),feature_link_declined:Eo(e=>typeof e=="string"?e==="true":e,$t().optional()),estimate_hours:Eo(e=>typeof e=="string"&&e.trim()!==""?Number(e):e,K().positive().optional()),created_at:ml,updated_at:ml});se({schema_version:ln(1),id:R().regex(Ep,{message:"feature id must match ^[A-Z][1-9]*$ (DD-14)"}),name:R().min(1),status:Oe(da),priority:Oe(Kl).optional(),tags:ke(R()).optional(),created_at:ml,updated_at:ml});const jR=se({name:R().min(1,"name is required"),background:R().optional(),requirements:R().optional(),design:R().optional(),plan:R().optional(),acceptance_criteria:R().optional(),feature_id:kS,parent_wbs:_S,priority:Oe(Kl).optional(),tags:ke(R()).optional(),template:Oe(Zl).optional(),estimate_hours:K().positive().optional()}).strict();ke(jR).min(1,"batch must contain at least one task");const MR=["NOT_FOUND","VALIDATION_FAILED","GUARD_DENIED","LOCK_TIMEOUT","CONFLICT","INTERNAL_ERROR"];function Nt(e){return se({ok:ln(!0),data:e})}se({ok:ln(!1),error:se({code:Oe(MR),message:R(),details:Pr().optional()})});se({nextCursor:R().optional(),hasMore:$t(),limit:K().int().positive()});const Rn=R().regex(Ep,{message:"feature id must match ^[A-Z][1-9]*$ (DD-14)"}),FR=se({id:Rn,name:R().min(1),status:Oe(da),priority:Oe(Kl).optional(),parentId:Rn.nullable().optional(),wbsCount:K().int().nonnegative().optional()}),PR=Nt(ke(FR)),BR=Nt(se({id:Rn,name:R(),status:Oe(da),frontmatter:zr(R(),Pr()),content:R(),filePath:R()})),UR=se({id:Rn}),$R=se({name:R().min(1),parentId:Rn.optional()}),zR=Nt(se({id:R(),filePath:R()})),HR=se({id:Rn,toStatus:Oe(da),actor:R().optional()}),GR=Nt(se({id:R(),status:Oe(da)})),WR=se({id:Rn,body:R(),actor:R().optional()}),qR=Nt(se({})),VR=Oe(["brainstorm","plan"]),YR=Oe(["claude","codex","gemini","pi","opencode","antigravity","openclaw"]),KR=se({id:Rn,action:VR,channel:YR.optional(),skipDeps:$t().optional()}),ZR=se({runId:R(),action:R(),status:ln("queued")}),XR=Nt(ZR),QR=se({id:Rn,name:R().min(1)}),JR=Nt(se({id:R(),filePath:R()})),eD=se({id:Rn,title:R().min(1)}),tD=Nt(se({wbs:R(),filePath:R()})),nD=se({id:Rn,wbs:R().regex(/^\d{4}$/)}),rD=Nt(se({})),CS=Oe(["pull","push"]),sD=se({id:Rn,direction:CS}),aD=Nt(se({direction:CS,affectedTasks:K().int().nonnegative(),applied:$t(),newStatus:R().optional()})),iD={list:ot.route({method:"GET",path:"/features",summary:"List features",tags:["feature"]}).output(PR),show:ot.route({method:"GET",path:"/features/{id}",summary:"Show feature detail",tags:["feature"]}).input(UR).output(BR),create:ot.route({method:"POST",path:"/features",summary:"Create a feature",tags:["feature"]}).input($R).output(zR),transition:ot.route({method:"PATCH",path:"/features/{id}/status",summary:"Transition feature status",tags:["feature"]}).input(HR).output(GR),refresh:ot.route({method:"POST",path:"/features/refresh",summary:"Refresh feature index and kanban",tags:["feature"]}).output(Nt(se({rebuilt:K().int().nonnegative(),skipped:ke(se({id:R(),reason:R()}))}))),check:ot.route({method:"POST",path:"/features/{id}/check",summary:"Run the four-layer feature check",tags:["feature"]}).input(se({id:Rn})).output(Nt(se({id:R(),status:R(),pass:$t(),findings:ke(se({layer:Oe(["L1","L2","L3","L4"]),severity:Oe(["error","warning","info"]),section:R(),message:R()})),requiredSections:ke(R()),missingSections:ke(R())}))),body:ot.route({method:"PATCH",path:"/features/{id}/body",summary:"Update feature body",tags:["feature"]}).input(WR).output(qR),action:ot.route({method:"POST",path:"/features/{id}/action",summary:"Run a feature workflow action",tags:["feature"]}).input(KR).output(XR),children:ot.route({method:"POST",path:"/features/{id}/children",summary:"Create a child feature",tags:["feature"]}).input(QR).output(JR),tasks:ot.route({method:"POST",path:"/features/{id}/tasks",summary:"Create a task linked to feature",tags:["feature"]}).input(eD).output(tD),link:ot.route({method:"PATCH",path:"/features/{id}/link",summary:"Link an existing task to feature",tags:["feature"]}).input(nD).output(rD),sync:ot.route({method:"POST",path:"/features/{id}/sync",summary:"Sync feature status with linked tasks",tags:["feature"]}).input(sD).output(aD)},IS=se({mode:Oe(["persistent","resume","one-shot"]),id:R().optional()}),oD=se({instanceId:R(),role:R().optional(),executor:R(),model:R().optional(),enabled:$t(),writeCapable:$t(),capabilityState:R(),session:IS.optional()}),lD=se({path:R().nullable(),enabled:$t(),strategy:se({name:R(),version:K()}).nullable(),orchestrator:se({state:Oe(["bound-online","bound-offline","missing","unresolvable"]),instanceId:R().optional(),holderId:R().optional(),reason:R().optional()}),members:ke(oD),capacity:se({total:K(),enabled:K(),writeCapable:K(),missing:ke(R())})}),uD=se({agentId:R(),pid:K().nullable(),status:Oe(["running","stopped","exited","errored"]),startedAt:R(),exitCode:K().nullable(),teamId:eR(),session:IS.optional()}),cD=se({id:R(),label:R(),command:R(),args:ke(R()),pid:K().nullable(),status:R(),startedAt:R(),exitedAt:R().nullable(),exitCode:K().nullable(),source:R(),teamId:R().nullable(),agentId:R().nullable()}),dD=se({processes:ke(uD),count:K(),executions:ke(cD),executionsCount:K()});se({name:R(),agent:R(),model:R().optional(),tier:R(),disabled:$t(),disabledOwner:R().optional(),disabledReason:R().optional(),disabledSince:R().optional(),installed:$t().optional(),usable:$t().optional(),version:R().nullable().optional(),error:R().nullable().optional(),elected:ke(R()).optional(),executionCapabilities:zr(R(),Pr()).optional(),sourceLayer:Oe(["project","global"]).optional(),sourcePath:R().optional()});se({id:R(),alias:R().optional(),description:R(),role:R(),tier:R(),skill:R().optional(),electedExecutor:R().nullable().optional(),candidateExecutors:ke(R()).optional()});const pD=se({name:R(),disabled:$t(),layer:Oe(["project","global"]).optional()}),fD=se({ok:$t(),status:Oe(["updated","unchanged"]),reason:R().optional(),targetLayer:Oe(["project","global"]).optional(),targetPath:R().optional()}),mD={snapshot:ot.route({method:"GET",path:"/project/fleet",summary:"Read the project fleet snapshot (declared roster + runtime session state)",tags:["fleet"]}).output(lD),setExecutorAvailability:ot.route({method:"POST",path:"/project/executors/availability",summary:"Toggle an executor availability state (Ready / Disabled) in project or global config",tags:["fleet"]}).input(pD).output(fD)},hD={list:ot.route({method:"GET",path:"/processes",summary:"List supervised agent processes and registry executions",tags:["processes"]}).output(dD)},i0=se({path:R(),displayPath:R(),exists:$t(),content:R(),sizeBytes:K(),updatedAt:R().nullable()}),gD=se({global:i0,project:i0});ot.route({method:"GET",path:"/project/configs",summary:"Read Spur project and global configuration files with raw YAML content",tags:["fleet"]}).output(gD);const bD=se({name:R(),kind:R(),version:R().nullable(),description:R().nullable(),path:R(),source:Oe(["project","registered","shared"]),valid:$t(),error:R().optional(),rawYaml:R(),mermaidDiagram:R()}),xD=se({workflows:ke(bD),total:K()});ot.route({method:"GET",path:"/project/workflows",summary:"List registered and available Spur workflows with raw YAML and Mermaid diagram definitions",tags:["fleet"]}).output(xD);const yD=Oe(["1h","4h","24h","7d","30d","all","custom"]),ED=Oe(["auto","1m","3m","5m","10m","30m","1h","4h","1d"]),SD=Oe(["model","source","tool","skill"]),Ni=se({range:yD.default("4h"),from:R().datetime().optional(),to:R().datetime().optional(),sources:ke(R()).optional(),models:ke(R()).optional(),tools:ke(R()).optional(),skills:ke(R()).optional(),bucket:ED.default("auto"),dimension:SD.default("model")}),Xl=se({billedTokens:K(),cacheSavedTokens:K(),cacheReadTokens:K(),freshInputTokens:K(),outputTokens:K()}),o0=se({totalBilledTokens:K(),cacheSavedTokens:K(),cacheSavedPercent:K(),sessionsCount:K(),toolCallsCount:K(),errorRate:K()}),TD=se({day:R(),totalBilledTokens:K(),cacheSavedTokens:K(),sessionsCount:K(),toolCallsCount:K(),cacheHitRatio:K()}),Ds=se({bucketStart:R(),cacheHitRatio:K(),gainRatio:K().optional(),series:zr(R(),K())}),l0=se({id:R(),label:R(),color:R(),tokens:K(),share:K(),freshInputTokens:K().optional(),cacheReadTokens:K().optional(),outputTokens:K().optional()}),ND=se({id:R(),count:K(),errors:K(),errorRate:K(),durationMs:K().optional(),tokens:K().optional(),usageShare:K().optional(),timeShare:K().optional(),tokenShare:K().optional()}),wD=se({id:R(),label:R(),color:R(),count:K()}),vD=se({bySkill:ke(se({skillName:R(),calls:K()})),bySource:ke(se({source:R(),calls:K()})),byInvocationKind:ke(se({invocationKind:R(),calls:K()})),trend:ke(Ds),fresh:$t().default(!0)}),AD=se({source:R(),sourceName:R(),color:R(),hitRatio:K(),savedTokens:K(),freshTokens:K(),totalRead:K(),billedTokens:K()}),kD=se({model:R(),modelName:R(),color:R(),hitRatio:K(),savedTokens:K(),freshTokens:K(),totalRead:K(),billedTokens:K()}),_D=se({source:R(),sourceName:R(),model:R(),modelName:R(),color:R(),hitRatio:K(),savedTokens:K(),totalRead:K(),billedTokens:K()}),CD=se({hitRatio:K(),savedTokens:K(),totalRead:K(),bySource:ke(AD).optional(),byModel:ke(kD).optional(),byAgentModel:ke(_D).optional()}),ID=se({kpis:o0,timeSeries:ke(Ds),topModels:ke(l0),topSources:ke(l0),topTools:ke(ND),skillsUsed:ke(wD),skillBreakdown:vD,cacheEfficiency:CD,kpiTrend:ke(TD),previousKpis:o0.nullable(),skillTimeSeries:ke(Ds),modelTimeSeries:ke(Ds).optional(),sourceTimeSeries:ke(Ds).optional(),toolTimeSeries:ke(Ds).optional()}),RD=Nt(ID),DD=Oe(["read","write","bash","search","run","user","assistant","unknown"]),RS=Oe(["measured","inferred","unmeasured"]),OD=Oe(["exact","estimated"]),LD=xp("mode",[se({mode:ln("session"),source:R().min(1),sessionId:R().min(1)}),se({mode:ln("consolidated"),filter:Ni.optional(),taskWbs:R().optional(),runId:R().optional()})]),jD=se({seq:K(),eventType:Oe(["message","tool"]),kind:DD,title:R(),toolName:R().nullable(),durationMs:K().nullable(),durationSource:RS,tokens:K(),freshInputTokens:K(),cacheReadTokens:K(),outputTokens:K(),promptTokens:Xl.nullable(),exitCode:K().nullable(),payload:R().nullable(),agent:R(),model:R()}),MD=se({key:R(),sessionId:R(),turnIndex:K(),timestamp:R().nullable(),source:R(),model:R(),correlationExactness:OD.nullable(),totalDurationMs:K(),totalTokens:K(),operationCount:K(),events:ke(jD)}),FD=se({sessionId:R().nullable(),source:R().nullable(),model:R().nullable(),start:R().nullable(),end:R().nullable(),durationMs:K(),tokens:Xl,messageCount:K(),toolCallCount:K(),sessionCount:K()}),PD=se({mode:Oe(["session","consolidated"]),scope:FD,truncated:$t(),blocks:ke(MD)}),BD=Nt(PD),UD=se({id:R(),source:R(),model:R(),modelDetail:R().optional(),start:R(),durationMs:K(),messages:K(),toolCalls:K(),billedTokens:K(),cacheReadTokens:K(),freshInputTokens:K(),outputTokens:K(),topTool:R(),state:R()}),$D=se({items:ke(UD),total:K(),page:K(),pageSize:K()}),zD=Nt($D),HD=se({filter:Ni.optional(),page:K().int().min(1).default(1),pageSize:K().int().min(1).max(100).default(20),sortBy:Oe(["start","duration","messages","toolCalls","billedTokens","cacheRead","freshInput"]).default("start"),sortDir:Oe(["asc","desc"]).default("desc")}),GD=Oe(["read","write","bash","search","mcp","other"]),WD=Oe(["all","ok","error"]),DS=se({seq:K(),toolSeq:K(),ts:R().nullable(),toolName:R(),category:GD,status:Oe(["ok","error","unknown"]),durationMs:K().nullable(),durationSource:RS,resultBytes:K().nullable(),argsRaw:R().nullable(),argsDigest:R().nullable(),errorText:R().nullable(),callId:R().nullable(),messageHash:R(),sessionId:R(),source:R(),model:R().nullable(),tokens:Xl}),qD=se({sessionId:R().nullable(),source:R().nullable(),model:R().nullable(),start:R().nullable(),end:R().nullable(),totalCalls:K(),uniqueTools:K(),errorCount:K(),errorRate:K(),totalDurationMs:K(),meanDurationMs:K(),durationUnmeasured:K(),sessionCount:K(),tokens:Xl}),VD=ES(xp("mode",[se({mode:ln("session"),source:R().min(1),sessionId:R().min(1)}),se({mode:ln("consolidated"),filter:Ni.optional()})]),se({toolNames:ke(R()).optional(),status:WD.default("all"),search:R().optional()})),YD=se({mode:Oe(["session","consolidated"]),scope:qD,truncated:$t(),items:ke(DS)}),KD=Nt(YD),ZD=se({tool:R(),argsHint:R(),sessionId:R(),repeats:K(),fromSeq:K(),toSeq:K(),wastedTokens:K(),repeatedCalls:ke(DS).optional()}),XD=se({sessionId:R(),timestamp:R(),freshTokens:K(),reason:R()}),QD=se({id:R(),source:R(),model:R(),tokens:K(),durationMs:K()}),u0=se({stepIndex:K(),sessionId:R(),toolName:R(),tokens:K(),durationMs:K().optional(),agent:R(),model:R()}),JD=se({model:R(),speedMsMean:K(),cacheRatio:K(),reliability:K(),outputRatio:K()}),eO=se({loops:ke(ZD),cacheWaste:ke(XD),heavySessions:ke(QD),largestTokenSteps:ke(u0),slowSteps:ke(u0),modelComparison:ke(JD)}),tO=Nt(eO),nO=se({date:R(),tokens:K(),sessions:K()}),rO=se({id:R(),name:R(),color:R(),importPath:R(),filePattern:R(),filesCount:K(),sizeMb:K().nullable(),sessionCount:K(),totalTokens:K(),cacheSavedTokens:K(),freshTokens:K(),toolCalls:K(),firstDate:R().nullable(),lastDate:R().nullable(),heatmapDays:ke(nO),maxDailyTokens:K()}),sO=se({agentId:R(),agentName:R(),path:R(),matchPattern:R(),fileCount:K(),status:Oe(["active","empty","missing"])}),aO=se({totalFiles:K(),corpusSizeBytes:K(),dateCoverage:se({from:R().nullable(),to:R().nullable()}),totalSessions:K(),lastImportedAt:R().nullable()}),iO=se({overview:aO,agents:ke(rO),roots:ke(sO)}),oO=Nt(iO),lO=se({mode:Oe(["full","incremental"]).default("incremental")}),uO=se({runId:R(),status:Oe(["queued","coalesced","already-running"]),message:R()}),cO=Nt(uO),dO={getSummary:ot.route({method:"POST",path:"/history/summary",summary:"Get conversation history analytics summary",tags:["history"]}).input(Ni.optional()).output(RD),getTimeline:ot.route({method:"POST",path:"/history/timeline",summary:"Get chronological session or consolidated execution timeline",tags:["history"]}).input(LD).output(BD),getToolSequence:ot.route({method:"POST",path:"/history/tool-sequence",summary:"Get ordered tool invocation sequence for a session or filtered scope",tags:["history"]}).input(VD).output(KD),getSessions:ot.route({method:"POST",path:"/history/sessions",summary:"List and filter conversation sessions",tags:["history"]}).input(HD).output(zD),getInsights:ot.route({method:"POST",path:"/history/insights",summary:"Get conversation forensic insights and loops",tags:["history"]}).input(Ni.optional()).output(tO),getSources:ot.route({method:"GET",path:"/history/sources",summary:"Get all-time agent sources overview and heatmaps",tags:["history"]}).output(oO),triggerImport:ot.route({method:"POST",path:"/history/import",summary:"Trigger history transcript import and analysis",tags:["history"]}).input(lO).output(cO)},pO=Nt(se({eventName:R(),occurredAt:R().datetime(),actor:R().nullable().optional(),payload:zr(R(),Pr())})),fO={stream:ot.route({method:"GET",path:"/events/planning",summary:"Stream planning events (SSE)",tags:["events"]}).output(pO)},mO=se({wbs:R().regex(/^\d{4}$/),name:R().min(1),status:Oe(Fn),priority:R().optional(),featureId:R().nullable().optional(),parentWbs:R().regex(/^\d{4}$/).nullable().optional(),type:Oe(vS).optional(),template:R().optional(),estimateHours:K().optional(),dependencyCount:K().optional(),filePath:R(),updatedAt:R().optional()}),hO=Nt(ke(mO)),gO=se({folder:R().optional(),status:R().optional(),parent:R().optional()}),bO=Nt(se({wbs:R(),name:R(),status:Oe(Fn),frontmatter:zr(R(),Pr()),content:R(),filePath:R()})),xO=se({wbs:R().regex(/^\d{4}$/)}),yO=se({title:R().min(1),featureId:R().optional(),parentWbs:R().regex(/^\d{4}$/).optional(),folder:R().optional(),template:Oe(Zl).optional()}),EO=Nt(se({wbs:R(),filePath:R()})),SO=se({wbs:R().regex(/^\d{4}$/),toStatus:Oe(Fn),actor:R().optional()}),TO=Nt(se({wbs:R(),status:Oe(Fn)})),NO=se({wbs:R().regex(/^\d{4}$/),body:R(),actor:R().optional()}),wO=Nt(se({wbs:R(),filePath:R()})),vO=Oe(["claude","codex","gemini","pi","opencode","antigravity","openclaw"]),AO=Oe(["refine","plan","run","verify","decompose","evaluate"]),kO=se({wbs:R().regex(/^\d{4}$/),action:AO,channel:vO.optional(),skipDeps:$t().optional()}),_O=Nt(se({runId:R(),action:R(),status:ln("queued")})),CO=se({path:R(),label:R().optional()}),IO=Nt(ke(CO)).extend({activeFolder:R().optional()}),RO={list:ot.route({method:"GET",path:"/tasks",summary:"List tasks",tags:["task"]}).input(gO).output(hO),folders:ot.route({method:"GET",path:"/tasks/folders",summary:"List configured task folders",tags:["task"]}).output(IO),show:ot.route({method:"GET",path:"/tasks/{wbs}",summary:"Show task detail",tags:["task"]}).input(xO).output(bO),create:ot.route({method:"POST",path:"/tasks",summary:"Create a task",tags:["task"]}).input(yO).output(EO),transition:ot.route({method:"PATCH",path:"/tasks/{wbs}/status",summary:"Transition task status",tags:["task"]}).input(SO).output(TO),body:ot.route({method:"PATCH",path:"/tasks/{wbs}/body",summary:"Update task body",tags:["task"]}).input(NO).output(wO),action:ot.route({method:"POST",path:"/tasks/{wbs}/actions",summary:"Run a task action",tags:["task"]}).input(kO).output(_O)},DO=se({totalEvents:K(),activeJobs:K(),completedJobs:K(),failedJobs:K(),successRatePct:K(),errorEventCount:K(),warningEventCount:K()}),OO=se({timestamp:R(),total:K(),byPrefix:zr(R(),K()),bySeverity:se({info:K(),warning:K(),error:K(),unknown:K()})}),LO=se({name:R(),prefix:R(),count:K(),latestAt:R(),avgDurationMs:K().nullable(),failureCount:K()}),jO=se({id:R(),source:Oe(["event","job"]),name:R(),occurredAt:R(),message:R(),refId:R().optional()});se({window:se({since:R(),until:R(),range:R()}),kpis:DO,eventVolumeBuckets:ke(OO),topEventTypes:ke(LO),recentErrors:ke(jO)});const MO=Oe(["pending","processing","completed","failed"]),FO=se({id:R(),type:R(),status:MO,attempts:K(),maxRetries:K(),queuedAt:R(),startedAt:R().nullable(),endedAt:R().nullable(),durationMs:K().nullable(),lastError:R().nullable(),payload:zr(R(),Pr()).nullable()}),PO=se({all:K(),pending:K(),processing:K(),completed:K(),failed:K()});se({jobs:ke(FO),total:K(),hasMore:$t(),countsByStatus:PO});const BO=Oe(["completed","failed","processing","none"]),UO=se({name:R(),cron:R(),cadence:R(),nextFireAt:R().nullable(),lastFiredAt:R().nullable(),lastStatus:BO,source:Oe(["builtin","config"])});se({schedules:ke(UO)});const $O=se({status:ln("ok"),timestamp:R(),service:ln("spur"),version:R()}),zO={health:ot.route({method:"GET",path:"/health",summary:"Read application health",tags:["system"]}).output($O),task:{...RO},board:{...RR},feature:{...iD},history:{...dO},fleet:{...mD},processes:{...hD},...fO};class HO extends z1{initRuntimeAdapter(t){for(const n of this.plugins)n.initRuntimeAdapter?.(t)}}class GO{fetch;toFetchRequestOptions;adapterInterceptors;constructor(t){new HO(t.plugins).initRuntimeAdapter(t),this.fetch=t.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=t,this.adapterInterceptors=ul(t.adapterInterceptors)}async call(t,n,r,s){const i=kk(t,this.toFetchRequestOptions),o=await od(this.adapterInterceptors,{...n,request:i,path:r,input:s,init:{redirect:"manual"}},({request:u,path:c,input:d,init:p,...f})=>this.fetch(u,p,f,c,d));return _k(o,{signal:i.signal})}}class WO{maxArrayIndex;constructor(t={}){this.maxArrayIndex=t.maxBracketNotationArrayIndex??9999}serialize(t,n=[],r=[]){if(Array.isArray(t))t.forEach((s,i)=>{this.serialize(s,[...n,i],r)});else if(Lr(t))for(const s in t)this.serialize(t[s],[...n,s],r);else r.push([this.stringifyPath(n),t]);return r}deserialize(t){if(t.length===0)return{};const n=new WeakSet,r={value:[]};for(const[s,i]of t){const o=this.parsePath(s);let l=r,u="value";o.forEach((c,d)=>{!Array.isArray(l[u])&&!Lr(l[u])&&(l[u]=[]),d!==o.length-1?Array.isArray(l[u])&&!c0(c,this.maxArrayIndex)&&(n.has(l[u])?(n.delete(l[u]),l[u]=d0(l[u])):l[u]=Ju(l[u])):Array.isArray(l[u])&&(c===""?l[u].length&&!n.has(l[u])&&(l[u]=Ju(l[u])):n.has(l[u])?(n.delete(l[u]),l[u]=d0(l[u])):c0(c,this.maxArrayIndex)||(l[u]=Ju(l[u]))),l=l[u],u=c}),Array.isArray(l)&&u===""?(n.add(l),l.push(i)):u in l?Array.isArray(l[u])?l[u].push(i):l[u]=[l[u],i]:l[u]=i}return r.value}stringifyPath(t){return t.map(n=>n.toString().replace(/[\\[\]]/g,r=>{switch(r){case"\\":return"\\\\";case"[":return"\\[";case"]":return"\\]";default:return r}})).reduce((n,r,s)=>s===0?r:`${n}[${r}]`,"")}parsePath(t){const n=[];let r=!1,s="",i=0;for(let o=0;o<t.length;o++){const l=t[o],u=t[o+1];r&&l==="]"&&(u===void 0||u==="[")&&i%2===0?(u===void 0&&(r=!1),n.push(s),s="",o++):n.length===0&&l==="["&&i%2===0?(r=!0,n.push(s),s=""):l==="\\"?i++:(s+="\\".repeat(i/2)+l,i=0)}return r||n.length===0?[t]:n}}function c0(e,t){return/^0$|^[1-9]\d*$/.test(e)&&Number(e)<=t}function Ju(e){const t=new I1;return e.forEach((n,r)=>{t[r]=n}),t}function d0(e){const t=new I1;return t[""]=e.length===1?e[0]:e,t}class qO{customSerializers;constructor(t={}){this.customSerializers=t.customJsonSerializers??[]}serialize(t,n={value:!1}){for(const r of this.customSerializers)if(r.condition(t))return this.serialize(r.serialize(t),n);if(t instanceof Blob)return n.value=!0,[t,n.value];if(t instanceof Set)return this.serialize(Array.from(t),n);if(t instanceof Map)return this.serialize(Array.from(t.entries()),n);if(Array.isArray(t))return[t.map(s=>s===void 0?null:this.serialize(s,n)[0]),n.value];if(Lr(t)){const r={};for(const s in t)s==="toJSON"&&typeof t[s]=="function"||(r[s]=this.serialize(t[s],n)[0]);return[r,n.value]}return typeof t=="bigint"||t instanceof RegExp||t instanceof URL?[t.toString(),n.value]:t instanceof Date?[Number.isNaN(t.getTime())?null:t.toISOString(),n.value]:Number.isNaN(t)?[null,n.value]:[t,n.value]}}function md(e){return`/${e.replace(/\/{2,}/g,"/").replace(/^\/|\/$/g,"")}`}function p0(e){return e?md(e).match(/\/\{[^}]+\}/g)?.map(t=>({raw:t,name:t.match(/\{\+?([^}]+)\}/)[1]})):void 0}class VO{constructor(t,n,r){this.contract=t,this.serializer=n,this.baseUrl=r.url,this.headers=r.headers??{},this.customErrorResponseBodyDecoder=r.customErrorResponseBodyDecoder}baseUrl;headers;customErrorResponseBodyDecoder;async encode(t,n,r){let s=Ik(await Dx(this.headers,r,t,n));r.lastEventId!==void 0&&(s=Ox(s,{"last-event-id":r.lastEventId}));const i=await Dx(this.baseUrl,r,t,n),o=Rx(this.contract,t);if(!cd(o))throw new Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${t.join(".")}`);return go("defaultInputStructure",o["~orpc"].route.inputStructure)==="compact"?this.#e(o,t,n,r,i,s):this.#t(o,t,n,r,i,s)}#e(t,n,r,s,i,o){let l=md(t["~orpc"].route.path??jx(n)),u=r;const c=p0(l);if(c?.length){if(!Lr(r))throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "compact" structure when has dynamic params at ${n.join(".")}.`);const f={...r};for(const m of c){const b=r[m.name];l=l.replace(m.raw,`/${encodeURIComponent(`${this.serializer.serialize(b)}`)}`),delete f[m.name]}u=Object.keys(f).length?f:void 0}const d=go("defaultMethod",t["~orpc"].route.method),p=new URL(i);if(p.pathname=`${p.pathname.replace(/\/$/,"")}${l}`,d==="GET"){const f=this.serializer.serialize(u,{outputFormat:"URLSearchParams"});for(const[m,b]of f)p.searchParams.append(m,b);return{url:p,method:d,headers:o,body:void 0,signal:s.signal}}return{url:p,method:d,headers:o,body:this.serializer.serialize(u),signal:s.signal}}#t(t,n,r,s,i,o){let l=md(t["~orpc"].route.path??jx(n));const u=p0(l);if(!Lr(r)&&r!==void 0)throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "detailed" structure at ${n.join(".")}.`);if(u?.length){if(!Lr(r?.params))throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input.params shape for "detailed" structure when has dynamic params at ${n.join(".")}.`);for(const f of u){const m=r.params[f.name];l=l.replace(f.raw,`/${encodeURIComponent(`${this.serializer.serialize(m)}`)}`)}}let c=o;if(r?.headers!==void 0){if(!Lr(r.headers))throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input.headers shape for "detailed" structure at ${n.join(".")}.`);c=Ox(r.headers,o)}const d=go("defaultMethod",t["~orpc"].route.method),p=new URL(i);if(p.pathname=`${p.pathname.replace(/\/$/,"")}${l}`,r?.query!==void 0){const f=this.serializer.serialize(r.query,{outputFormat:"URLSearchParams"});for(const[m,b]of f)p.searchParams.append(m,b)}return d==="GET"?{url:p,method:d,headers:c,body:void 0,signal:s.signal}:{url:p,method:d,headers:c,body:this.serializer.serialize(r?.body),signal:s.signal}}async decode(t,n,r){const s=!yi(t.status),i=await(async()=>{let u=!1;try{const c=await t.body();return u=!0,this.serializer.deserialize(c)}catch(c){throw u?new Error("Invalid OpenAPI response format.",{cause:c}):new Error("Cannot parse response body, please check the response body and content-type.",{cause:c})}})();if(!s){const u=this.customErrorResponseBodyDecoder?.(i,t);throw u??(O1(i)?L1(i):new xi(Rk(t.status),{status:t.status,data:{...t,body:i}}))}const o=Rx(this.contract,r);if(!cd(o))throw new Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${r.join(".")}`);return go("defaultOutputStructure",o["~orpc"].route.outputStructure)==="compact"?i:{status:t.status,headers:t.headers,body:i}}}class YO{constructor(t,n){this.jsonSerializer=t,this.bracketNotation=n}serialize(t,n={}){return bi(t)&&!n.outputFormat?Lx(t,{value:async r=>this.#e(r,{outputFormat:"plain"}),error:async r=>new Ei({data:this.#e(dk(r).toJSON(),{outputFormat:"plain"}),cause:r})}):this.#e(t,n)}#e(t,n){const[r,s]=this.jsonSerializer.serialize(t);if(n.outputFormat==="plain")return r;if(n.outputFormat==="URLSearchParams"){const o=new URLSearchParams;for(const[l,u]of this.bracketNotation.serialize(r))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&o.append(l,u.toString());return o}if(r instanceof Blob||r===void 0||!s)return r;const i=new FormData;for(const[o,l]of this.bracketNotation.serialize(r))typeof l=="string"||typeof l=="number"||typeof l=="boolean"?i.append(o,l.toString()):l instanceof Blob&&i.append(o,l);return i}deserialize(t){return t instanceof URLSearchParams||t instanceof FormData?this.bracketNotation.deserialize(Array.from(t.entries())):bi(t)?Lx(t,{value:async n=>n,error:async n=>n instanceof Ei&&O1(n.data)?L1(n.data,{cause:n}):n}):t}}class KO extends Ck{constructor(t,n,r){const s=new qO(r),i=new WO({maxBracketNotationArrayIndex:4294967294}),o=new YO(s,i),l=new VO(t,o,r);super(l,n,r)}}class ZO extends KO{constructor(t,n){const r=new GO(n);super(t,r,n)}}function nt(e=void 0,t=globalThis.location?.origin,n=!1){return e||(t&&t!=="null"?new URL("/api",t).toString():"http://localhost:3000/api")}function Ge(e,t=1e4){const n=new AbortController,r=setTimeout(()=>n.abort(),t),s=e.signal;s&&s.addEventListener("abort",()=>n.abort(),{once:!0});const i=new Request(e,{signal:n.signal});return fetch(i).finally(()=>clearTimeout(r))}function XO(e){return Ge(e)}function QO(e){typeof globalThis<"u"&&globalThis.dispatchEvent&&globalThis.dispatchEvent(new CustomEvent("api-error",{detail:{message:e instanceof Error?e.message:String(e)}}))}const Pt=B1(new ZO(zO,{url:nt(),fetch:XO,adapterInterceptors:[nk(QO)]})),JO={display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0,minHeight:0,height:"100%"},eL={flex:"1 1 auto",minWidth:0,minHeight:0,width:"100%",border:"0",display:"block"};function tL({moduleId:e,url:t,title:n}){return a.jsxs("div",{className:"framed-resource","data-testid":"framed-resource","data-module-id":e,"data-framed-url":t,style:JO,children:[a.jsx("div",{className:"flex items-center justify-end gap-2 border-b border-spur-border bg-spur-surface px-3 py-1",children:a.jsx("a",{className:"text-xs font-medium text-spur-text underline underline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-spur-accent","data-testid":"framed-resource-external",href:t,target:"_blank",rel:"noopener noreferrer",children:"Open externally"})}),a.jsx("iframe",{className:"framed-resource-frame","data-testid":"framed-resource-frame",src:t,title:n,style:eL})]})}const nL={catalog:"The project module catalog could not be read.",import:"Its compiled browser entry did not load (timed out or failed).",style:"Its stylesheet did not load, so it was not displayed.",export:"Its entry did not publish a usable Board contribution.",version:"It targets a contribution API version this Board does not support.",render:"It failed while rendering.",panel:"Its right panel failed while rendering.",unsupported:"This Board build cannot render this contribution type yet."};function OS(e){return e.replace(/(?:^|[\s("'])\/[\w.@%+-]+\/[\w.@%+/-]+/g," [redacted path]")}function LS({diagnostic:e}){return a.jsxs("div",{role:"alert","data-testid":"module-diagnostic","data-module-id":e.moduleId,"data-failure-category":e.category,className:"m-4 rounded-md border border-spur-border bg-spur-surface p-4 text-sm text-spur-text",children:[a.jsxs("p",{className:"font-semibold",children:["“",e.moduleId,"” could not be displayed."]}),a.jsx("p",{className:"mt-1 text-spur-text-muted",children:nL[e.category]}),a.jsxs("p",{className:"mt-1 font-mono text-xs text-spur-text-muted",children:[e.category,": ",OS(e.message)]}),a.jsx("p",{className:"mt-1 text-spur-text-muted",children:"Reload this page after fixing the project module configuration. Other modules stay usable."})]})}function rL({diagnostics:e}){return e.length===0?null:a.jsx("div",{role:"status","data-testid":"board-diagnostics",className:"border-b border-spur-border bg-spur-surface px-4 py-2 text-xs text-spur-text",children:e.map(t=>a.jsxs("p",{children:[t.moduleId,": ",OS(t.message)]},`${t.moduleId}:${t.category}`))})}class jS extends g.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}render(){const{error:t}=this.state;return t?a.jsx(LS,{diagnostic:{moduleId:this.props.moduleId,category:this.props.category??"render",message:t.message}}):this.props.children}}const sL=1e4;function aL(e){return import(e)}const f0=new Set,So=new Map;function iL(e){if(f0.has(e))return Promise.resolve();const t=So.get(e);if(t)return t;const n=new Promise((r,s)=>{const i=document.createElement("link");i.rel="stylesheet",i.href=e,i.addEventListener("load",()=>{f0.add(e),So.delete(e),r()}),i.addEventListener("error",()=>{So.delete(e),s(new Error(`stylesheet failed to load: ${e}`))}),document.head.append(i)});return So.set(e,n),n}function m0(e,t,n){return new Promise((r,s)=>{const i=setTimeout(()=>s(new Error(`${n} exceeded ${t}ms`)),t);e.then(o=>{clearTimeout(i),r(o)},o=>{clearTimeout(i),s(o instanceof Error?o:new Error(String(o)))})})}function oL(e){return e.route.replace(/^\//,"").replace(/\/$/,"")}function lL(e,t){return{...Sp(e),component:()=>g.createElement(LS,{diagnostic:t}),contributionType:e.type}}function Sp(e){return{id:e.id,name:e.name,icon:e.icon,route:oL(e),sidebarLabel:e.sidebarLabel,description:e.description,order:e.order}}function uL(e,t,n){const r=e?.webModule;if(r===null||typeof r!="object")return{moduleId:t.id,category:"export",message:'named export "webModule" is missing'};const{apiVersion:s,component:i}=r;return s!==n?{moduleId:t.id,category:"version",message:`contribution apiVersion ${String(s)} is not supported (host ${n})`}:typeof i!="function"?{moduleId:t.id,category:"export",message:"webModule.component is not a component"}:r}function MS(e){return"category"in e}async function cL(e,t,n){for(const i of e.styles)try{await m0(n.loadStyle(i),n.timeoutMs,"stylesheet load")}catch(o){return{moduleId:e.id,category:"style",message:o instanceof Error?o.message:String(o)}}let r;try{r=await m0(n.importEntry(e.entryUrl),n.timeoutMs,"entry import")}catch(i){return{moduleId:e.id,category:"import",message:i instanceof Error?i.message:String(i)}}const s=uL(r,e,t);return MS(s)?s:{...Sp(e),component:s.component,rightPanelComponent:s.rightPanelComponent,contributionType:"react"}}async function dL(e,t,n={}){const r=n.loadTimeoutMs??sL,s=n.importEntry??aL,i=n.loadStyle??iL;if(!e)return{modules:t,hostDiagnostics:[{moduleId:"catalog",category:"catalog",message:"the project module catalog could not be read"}]};if(!e.host)return{modules:t,hostDiagnostics:[{moduleId:"catalog",category:"unsupported",message:"no Board web distribution is installed, so downstream modules cannot be rendered"}]};const o=e.host.contributionApiVersion,l=[...e.modules].sort((c,d)=>(c.order??Number.POSITIVE_INFINITY)-(d.order??Number.POSITIVE_INFINITY)||c.id.localeCompare(d.id)),u=await Promise.all(l.map(async c=>{if(c.type==="iframe")return{...Sp(c),component:()=>g.createElement(tL,{moduleId:c.id,url:c.url,title:c.name}),contributionType:"iframe"};const d=await cL(c,o,{timeoutMs:r,importEntry:s,loadStyle:i});return MS(d)?lL(c,d):d}));return{modules:[...t,...u],hostDiagnostics:[]}}const pL=[];function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(null,arguments)}const Ui=(function(e){if(e==null)return gL;if(typeof e=="function")return Ql(e);if(typeof e=="object")return Array.isArray(e)?fL(e):mL(e);if(typeof e=="string")return hL(e);throw new Error("Expected function, string, or object as test")});function fL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ui(e[n]);return Ql(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function mL(e){const t=e;return Ql(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function hL(e){return Ql(t);function t(n){return n&&n.type===e}}function Ql(e){return t;function t(n,r,s){return!!(bL(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function gL(){return!0}function bL(e){return e!==null&&typeof e=="object"&&"type"in e}const FS=[],xL=!0,hl=!1,Ja="skip";function Tp(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=Ui(s),o=r?-1:1;l(e,void 0,[])();function l(u,c,d){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const m=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=FS,b,x,y;if((!t||i(u,c,d[d.length-1]||void 0))&&(m=yL(n(u,d)),m[0]===hl))return m;if("children"in u&&u.children){const E=u;if(E.children&&m[0]!==Ja)for(x=(r?E.children.length:-1)+o,y=d.concat(E);x>-1&&x<E.children.length;){const v=E.children[x];if(b=l(v,x,y)(),b[0]===hl)return b;x=typeof b[1]=="number"?b[1]:x+o}}return m}}}function yL(e){return Array.isArray(e)?e:typeof e=="number"?[xL,e]:e==null?FS:[e]}function vn(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),Tp(e,i,l,s);function l(u,c){const d=c[c.length-1],p=d?d.children.indexOf(u):void 0;return o(u,p,d)}}function Ps(e){return"children"in e?PS(e):"value"in e?e.value:""}function EL(e){return e.type==="text"?e.value:"children"in e?PS(e):""}function PS(e){let t=-1;const n=[];for(;++t<e.children.length;)n[t]=EL(e.children[t]);return n.join("")}const SL={}.hasOwnProperty;function TL(e,t,n){const r=Ui(t),s=t&&typeof t=="object"&&"cascade"in t?t.cascade:void 0,i=s??!0;return o(e);function o(l,u,c){const d=[];if(!r(l,u,c))return;if(NL(l)){let m=-1;for(;++m<l.children.length;){const b=o(l.children[m],m,l);b&&d.push(b)}if(i&&l.children.length>0&&d.length===0)return}const p={};let f;for(f in l)SL.call(l,f)&&(p[f]=f==="children"?d:l[f]);return p}}function NL(e){return"children"in e&&e.children!==void 0}var To={exports:{}},h0;function wL(){return h0||(h0=1,(function(e,t){function n(r){let s=[],i;for(let o of r.split(",").map(l=>l.trim()))if(/^-?\d+$/.test(o))s.push(parseInt(o,10));else if(i=o.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[l,u,c,d]=i;if(u&&d){u=parseInt(u),d=parseInt(d);const p=u<d?1:-1;(c==="-"||c===".."||c==="‥")&&(d+=p);for(let f=u;f!==d;f+=p)s.push(f)}}return s}t.default=n,e.exports=n})(To,To.exports)),To.exports}var vL=wL();const AL=zl(vL);rt.displayName="clike";rt.aliases=[];function rt(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}Yn.displayName="c";Yn.aliases=[];function Yn(e){e.register(rt),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}ps.displayName="cpp";ps.aliases=[];function ps(e){e.register(Yn),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Jl.displayName="arduino";Jl.aliases=["ino"];function Jl(e){e.register(ps),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}$i.displayName="bash";$i.aliases=["sh","shell"];function $i(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=s.variable[1].inside,l=0;l<i.length;l++)o[i[l]]=t.languages.bash[i[l]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(e)}fs.displayName="csharp";fs.aliases=["cs","dotnet"];function fs(e){e.register(rt),(function(t){function n(I,Z){return I.replace(/<<(\d+)>>/g,function(ie,L){return"(?:"+Z[+L]+")"})}function r(I,Z,ie){return RegExp(n(I,Z),"")}function s(I,Z){for(var ie=0;ie<Z;ie++)I=I.replace(/<<self>>/g,function(){return"(?:"+I+")"});return I.replace(/<<self>>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function o(I){return"\\b(?:"+I.trim().replace(/ /g,"|")+")\\b"}var l=o(i.typeDeclaration),u=RegExp(o(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),c=o(i.typeDeclaration+" "+i.contextual+" "+i.other),d=o(i.type+" "+i.typeDeclaration+" "+i.other),p=s(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),f=s(/\((?:[^()]|<<self>>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,b=n(/<<0>>(?:\s*<<1>>)?/.source,[m,p]),x=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[c,b]),y=/\[\s*(?:,\s*)*\]/.source,E=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[x,y]),v=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,f,y]),S=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[v]),A=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[S,x,y]),N={keyword:u,punctuation:/[<>()?,.:[\]]/},T=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,w=/"(?:\\.|[^\\"\r\n])*"/.source,k=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[k]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[w]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[x]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,A]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,b]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[x]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[E]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[A,d,m]),inside:N}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:N},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[A,x]),inside:N,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[A]),lookbehind:!0,inside:N,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,p]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(p),alias:"class-name",inside:N}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[l,b,m,A,u.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[b,f]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(A),greedy:!0,inside:N},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var F=w+"|"+T,C=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[F]),$=s(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),z=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,M=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[x,$]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[z,M]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[z]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:t.languages.csharp},"class-name":{pattern:RegExp(x),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var G=/:[^}\r\n]+/.source,H=s(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),j=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[H,G]),q=s(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[F]),2),re=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[q,G]);function pe(I,Z){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[I]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[Z,G]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[j]),lookbehind:!0,greedy:!0,inside:pe(j,H)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[re]),lookbehind:!0,greedy:!0,inside:pe(re,q)}],char:{pattern:RegExp(T),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}rn.displayName="markup";rn.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function rn(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Hr.displayName="css";Hr.aliases=[];function Hr(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}eu.displayName="diff";eu.aliases=[];function eu(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
|
|
79
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const l=o[1];if(t===o[0]){i(o);continue}if(e.external){const c=e.external.registry.get(o[0])?.id;if(t!==o[0]&&c){i(o);continue}}if(e.metadataRegistry.get(o[0])?.id){i(o);continue}if(l.cycle){i(o);continue}if(l.count>1&&e.reused==="ref"){i(o);continue}}}function hS(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const u=e.seen.get(l);if(u.ref===null)return;const c=u.def??u.schema,d={...c},p=u.ref;if(u.ref=null,p){r(p);const m=e.seen.get(p),b=m.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(b)):Object.assign(c,b),Object.assign(c,d),l._zod.parent===p)for(const y in c)y==="$ref"||y==="allOf"||y in d||delete c[y];if(b.$ref&&m.def)for(const y in c)y==="$ref"||y==="allOf"||y in m.def&&JSON.stringify(c[y])===JSON.stringify(m.def[y])&&delete c[y]}const f=l._zod.parent;if(f&&f!==p){r(f);const m=e.seen.get(f);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(const b in c)b==="$ref"||b==="allOf"||b in m.def&&JSON.stringify(c[b])===JSON.stringify(m.def[b])&&delete c[b]}e.override({zodSchema:l,jsonSchema:c,path:u.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(l)}Object.assign(s,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;i!==void 0&&s.id===i&&delete s.id;const o=e.external?.defs??{};for(const l of e.seen.entries()){const u=l[1];u.def&&u.defId&&(u.def.id===u.defId&&delete u.def.id,o[u.defId]=u.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const l=JSON.parse(JSON.stringify(s));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:fl(t,"input",e.processors),output:fl(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function gn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return gn(r.element,n);if(r.type==="set")return gn(r.valueType,n);if(r.type==="lazy")return gn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return gn(r.innerType,n);if(r.type==="intersection")return gn(r.left,n)||gn(r.right,n);if(r.type==="record"||r.type==="map")return gn(r.keyType,n)||gn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:gn(r.in,n)||gn(r.out,n);if(r.type==="object"){for(const s in r.shape)if(gn(r.shape[s],n))return!0;return!1}if(r.type==="union"){for(const s of r.options)if(gn(s,n))return!0;return!1}if(r.type==="tuple"){for(const s of r.items)if(gn(s,n))return!0;return!!(r.rest&&gn(r.rest,n))}return!1}const z2=(e,t={})=>n=>{const r=fS({...n,processors:t});return qt(e,r),mS(r,e),hS(r,e)},fl=(e,t,n={})=>r=>{const{libraryOptions:s,target:i}=r??{},o=fS({...s??{},target:i,io:t,processors:n});return qt(e,o),mS(o,e),hS(o,e)},H2={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},G2=(e,t,n,r)=>{const s=n;s.type="string";const{minimum:i,maximum:o,format:l,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof i=="number"&&(s.minLength=i),typeof o=="number"&&(s.maxLength=o),l&&(s.format=H2[l]??l,s.format===""&&delete s.format,l==="time"&&delete s.format),c&&(s.contentEncoding=c),u&&u.size>0){const d=[...u];d.length===1?s.pattern=d[0].source:d.length>1&&(s.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},W2=(e,t,n,r)=>{const s=n,{minimum:i,maximum:o,format:l,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;typeof l=="string"&&l.includes("int")?s.type="integer":s.type="number";const p=typeof d=="number"&&d>=(i??Number.NEGATIVE_INFINITY),f=typeof c=="number"&&c<=(o??Number.POSITIVE_INFINITY),m=t.target==="draft-04"||t.target==="openapi-3.0";p?m?(s.minimum=d,s.exclusiveMinimum=!0):s.exclusiveMinimum=d:typeof i=="number"&&(s.minimum=i),f?m?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof o=="number"&&(s.maximum=o),typeof u=="number"&&(s.multipleOf=u)},q2=(e,t,n,r)=>{n.type="boolean"},V2=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Y2=(e,t,n,r)=>{n.not={}},K2=(e,t,n,r)=>{},Z2=(e,t,n,r)=>{const s=e._zod.def,i=W1(s.entries);i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),n.enum=i},X2=(e,t,n,r)=>{const s=e._zod.def,i=[];for(const o of s.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");i.push(Number(o))}else i.push(o);if(i.length!==0)if(i.length===1){const o=i[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else i.every(o=>typeof o=="number")&&(n.type="number"),i.every(o=>typeof o=="string")&&(n.type="string"),i.every(o=>typeof o=="boolean")&&(n.type="boolean"),i.every(o=>o===null)&&(n.type="null"),n.enum=i},Q2=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},J2=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},eI=(e,t,n,r)=>{const s=n,i=e._zod.def,{minimum:o,maximum:l}=e._zod.bag;typeof o=="number"&&(s.minItems=o),typeof l=="number"&&(s.maxItems=l),s.type="array",s.items=qt(i.element,t,{...r,path:[...r.path,"items"]})},tI=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object",s.properties={};const o=i.shape;for(const c in o)s.properties[c]=qt(o[c],t,{...r,path:[...r.path,"properties",c]});const l=new Set(Object.keys(o)),u=new Set([...l].filter(c=>{const d=i.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(s.required=Array.from(u)),i.catchall?._zod.def.type==="never"?s.additionalProperties=!1:i.catchall?i.catchall&&(s.additionalProperties=qt(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},nI=(e,t,n,r)=>{const s=e._zod.def,i=s.inclusive===!1,o=s.options.map((l,u)=>qt(l,t,{...r,path:[...r.path,i?"oneOf":"anyOf",u]}));i?n.oneOf=o:n.anyOf=o},rI=(e,t,n,r)=>{const s=e._zod.def,i=qt(s.left,t,{...r,path:[...r.path,"allOf",0]}),o=qt(s.right,t,{...r,path:[...r.path,"allOf",1]}),l=c=>"allOf"in c&&Object.keys(c).length===1,u=[...l(i)?i.allOf:[i],...l(o)?o.allOf:[o]];n.allOf=u},sI=(e,t,n,r)=>{const s=n,i=e._zod.def;s.type="object";const o=i.keyType,u=o._zod.bag?.patterns;if(i.mode==="loose"&&u&&u.size>0){const d=qt(i.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});s.patternProperties={};for(const p of u)s.patternProperties[p.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=qt(i.keyType,t,{...r,path:[...r.path,"propertyNames"]})),s.additionalProperties=qt(i.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const c=o._zod.values;if(c){const d=[...c].filter(p=>typeof p=="string"||typeof p=="number");d.length>0&&(s.required=d)}},aI=(e,t,n,r)=>{const s=e._zod.def,i=qt(s.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=s.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]},iI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},oI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},lI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},uI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType;let o;try{o=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},cI=(e,t,n,r)=>{const s=e._zod.def,i=s.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?i?s.out:s.in:s.out;qt(o,t,r);const l=t.seen.get(e);l.ref=o},dI=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType,n.readOnly=!0},gS=(e,t,n,r)=>{const s=e._zod.def;qt(s.innerType,t,r);const i=t.seen.get(e);i.ref=s.innerType},pI=ae("ZodISODateTime",(e,t)=>{cC.init(e,t),jt.init(e,t)});function fI(e){return b2(pI,e)}const mI=ae("ZodISODate",(e,t)=>{dC.init(e,t),jt.init(e,t)});function hI(e){return x2(mI,e)}const gI=ae("ZodISOTime",(e,t)=>{pC.init(e,t),jt.init(e,t)});function bI(e){return y2(gI,e)}const xI=ae("ZodISODuration",(e,t)=>{fC.init(e,t),jt.init(e,t)});function yI(e){return E2(xI,e)}const EI=(e,t)=>{K1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>t_(e,n)},flatten:{value:n=>e_(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,dd,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,dd,2)}},isEmpty:{get(){return e.issues.length===0}}})},$n=ae("ZodError",EI,{Parent:Error}),SI=hp($n),TI=gp($n),NI=ql($n),wI=Vl($n),vI=s_($n),AI=a_($n),kI=i_($n),_I=o_($n),CI=l_($n),II=u_($n),RI=c_($n),DI=d_($n),Jx=new WeakMap;function Bi(e,t,n){const r=Object.getPrototypeOf(e);let s=Jx.get(r);if(s||(s=new Set,Jx.set(r,s)),!s.has(t)){s.add(t);for(const i in n){const o=n[i];Object.defineProperty(r,i,{configurable:!0,enumerable:!1,get(){const l=o.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}const Dt=ae("ZodType",(e,t)=>(It.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:fl(e,"input"),output:fl(e,"output")}}),e.toJSONSchema=z2(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>SI(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>NI(e,n,r),e.parseAsync=async(n,r)=>TI(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>wI(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>vI(e,n,r),e.decode=(n,r)=>AI(e,n,r),e.encodeAsync=async(n,r)=>kI(e,n,r),e.decodeAsync=async(n,r)=>_I(e,n,r),e.safeEncode=(n,r)=>CI(e,n,r),e.safeDecode=(n,r)=>II(e,n,r),e.safeEncodeAsync=async(n,r)=>RI(e,n,r),e.safeDecodeAsync=async(n,r)=>DI(e,n,r),Bi(e,"ZodType",{check(...n){const r=this.def;return this.clone(Ur(r,{checks:[...r.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return $r(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(vR(n,r))},superRefine(n,r){return this.check(AR(n,r))},overwrite(n){return this.check(ca(n))},optional(){return r0(this)},exactOptional(){return pR(this)},nullable(){return s0(this)},nullish(){return r0(s0(this))},nonoptional(n){return xR(this,n)},array(){return ke(this)},or(n){return iR([this,n])},and(n){return ES(this,n)},transform(n){return a0(this,SS(n))},default(n){return hR(this,n)},prefault(n){return bR(this,n)},catch(n){return ER(this,n)},pipe(n){return a0(this,n)},readonly(){return NR(this)},describe(n){const r=this.clone();return Va.add(r,{description:n}),r},meta(...n){if(n.length===0)return Va.get(this);const r=this.clone();return Va.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Va.get(e)?.description},configurable:!0}),e)),bS=ae("_ZodString",(e,t)=>{bp.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(r,s,i)=>G2(e,r,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Bi(e,"_ZodString",{regex(...r){return this.check(k2(...r))},includes(...r){return this.check(I2(...r))},startsWith(...r){return this.check(R2(...r))},endsWith(...r){return this.check(D2(...r))},min(...r){return this.check(pl(...r))},max(...r){return this.check(dS(...r))},length(...r){return this.check(pS(...r))},nonempty(...r){return this.check(pl(1,...r))},lowercase(r){return this.check(_2(r))},uppercase(r){return this.check(C2(r))},trim(){return this.check(L2())},normalize(...r){return this.check(O2(...r))},toLowerCase(){return this.check(j2())},toUpperCase(){return this.check(M2())},slugify(){return this.check(F2())}})}),OI=ae("ZodString",(e,t)=>{bp.init(e,t),bS.init(e,t),e.email=n=>e.check(ZC(LI,n)),e.url=n=>e.check(t2(jI,n)),e.jwt=n=>e.check(g2(ZI,n)),e.emoji=n=>e.check(n2(MI,n)),e.guid=n=>e.check(Kx(e0,n)),e.uuid=n=>e.check(XC(yo,n)),e.uuidv4=n=>e.check(QC(yo,n)),e.uuidv6=n=>e.check(JC(yo,n)),e.uuidv7=n=>e.check(e2(yo,n)),e.nanoid=n=>e.check(r2(FI,n)),e.guid=n=>e.check(Kx(e0,n)),e.cuid=n=>e.check(s2(PI,n)),e.cuid2=n=>e.check(a2(BI,n)),e.ulid=n=>e.check(i2(UI,n)),e.base64=n=>e.check(f2(VI,n)),e.base64url=n=>e.check(m2(YI,n)),e.xid=n=>e.check(o2($I,n)),e.ksuid=n=>e.check(l2(zI,n)),e.ipv4=n=>e.check(u2(HI,n)),e.ipv6=n=>e.check(c2(GI,n)),e.cidrv4=n=>e.check(d2(WI,n)),e.cidrv6=n=>e.check(p2(qI,n)),e.e164=n=>e.check(h2(KI,n)),e.datetime=n=>e.check(fI(n)),e.date=n=>e.check(hI(n)),e.time=n=>e.check(bI(n)),e.duration=n=>e.check(yI(n))});function R(e){return KC(OI,e)}const jt=ae("ZodStringFormat",(e,t)=>{Rt.init(e,t),bS.init(e,t)}),LI=ae("ZodEmail",(e,t)=>{tC.init(e,t),jt.init(e,t)}),e0=ae("ZodGUID",(e,t)=>{J_.init(e,t),jt.init(e,t)}),yo=ae("ZodUUID",(e,t)=>{eC.init(e,t),jt.init(e,t)}),jI=ae("ZodURL",(e,t)=>{nC.init(e,t),jt.init(e,t)}),MI=ae("ZodEmoji",(e,t)=>{rC.init(e,t),jt.init(e,t)}),FI=ae("ZodNanoID",(e,t)=>{sC.init(e,t),jt.init(e,t)}),PI=ae("ZodCUID",(e,t)=>{aC.init(e,t),jt.init(e,t)}),BI=ae("ZodCUID2",(e,t)=>{iC.init(e,t),jt.init(e,t)}),UI=ae("ZodULID",(e,t)=>{oC.init(e,t),jt.init(e,t)}),$I=ae("ZodXID",(e,t)=>{lC.init(e,t),jt.init(e,t)}),zI=ae("ZodKSUID",(e,t)=>{uC.init(e,t),jt.init(e,t)}),HI=ae("ZodIPv4",(e,t)=>{mC.init(e,t),jt.init(e,t)}),GI=ae("ZodIPv6",(e,t)=>{hC.init(e,t),jt.init(e,t)}),WI=ae("ZodCIDRv4",(e,t)=>{gC.init(e,t),jt.init(e,t)}),qI=ae("ZodCIDRv6",(e,t)=>{bC.init(e,t),jt.init(e,t)}),VI=ae("ZodBase64",(e,t)=>{xC.init(e,t),jt.init(e,t)}),YI=ae("ZodBase64URL",(e,t)=>{EC.init(e,t),jt.init(e,t)}),KI=ae("ZodE164",(e,t)=>{SC.init(e,t),jt.init(e,t)}),ZI=ae("ZodJWT",(e,t)=>{NC.init(e,t),jt.init(e,t)}),xS=ae("ZodNumber",(e,t)=>{aS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(r,s,i)=>W2(e,r,s),Bi(e,"ZodNumber",{gt(r,s){return this.check(Xx(r,s))},gte(r,s){return this.check(Qu(r,s))},min(r,s){return this.check(Qu(r,s))},lt(r,s){return this.check(Zx(r,s))},lte(r,s){return this.check(Xu(r,s))},max(r,s){return this.check(Xu(r,s))},int(r){return this.check(t0(r))},safe(r){return this.check(t0(r))},positive(r){return this.check(Xx(0,r))},nonnegative(r){return this.check(Qu(0,r))},negative(r){return this.check(Zx(0,r))},nonpositive(r){return this.check(Xu(0,r))},multipleOf(r,s){return this.check(Qx(r,s))},step(r,s){return this.check(Qx(r,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function K(e){return S2(xS,e)}const XI=ae("ZodNumberFormat",(e,t)=>{wC.init(e,t),xS.init(e,t)});function t0(e){return T2(XI,e)}const QI=ae("ZodBoolean",(e,t)=>{vC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>q2(e,n,r)});function $t(e){return N2(QI,e)}const JI=ae("ZodNull",(e,t)=>{AC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>V2(e,n,r)});function eR(e){return w2(JI,e)}const tR=ae("ZodUnknown",(e,t)=>{kC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>K2()});function Pr(){return v2(tR)}const nR=ae("ZodNever",(e,t)=>{_C.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Y2(e,n,r)});function rR(e){return A2(nR,e)}const sR=ae("ZodArray",(e,t)=>{CC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>eI(e,n,r,s),e.element=t.element,Bi(e,"ZodArray",{min(n,r){return this.check(pl(n,r))},nonempty(n){return this.check(pl(1,n))},max(n,r){return this.check(dS(n,r))},length(n,r){return this.check(pS(n,r))},unwrap(){return this.element}})});function ke(e,t){return P2(sR,e,t)}const aR=ae("ZodObject",(e,t)=>{RC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>tI(e,n,r,s),xt(e,"shape",()=>t.shape),Bi(e,"ZodObject",{keyof(){return Oe(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:Pr()})},loose(){return this.clone({...this._zod.def,catchall:Pr()})},strict(){return this.clone({...this._zod.def,catchall:rR()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return Yk(this,n)},safeExtend(n){return Kk(this,n)},merge(n){return Zk(this,n)},pick(n){return qk(this,n)},omit(n){return Vk(this,n)},partial(...n){return Xk(TS,this,n[0])},required(...n){return Qk(NS,this,n[0])}})});function se(e,t){const n={type:"object",shape:e??{},...Le(t)};return new aR(n)}const yS=ae("ZodUnion",(e,t)=>{lS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>nI(e,n,r,s),e.options=t.options});function iR(e,t){return new yS({type:"union",options:e,...Le(t)})}const oR=ae("ZodDiscriminatedUnion",(e,t)=>{yS.init(e,t),DC.init(e,t)});function xp(e,t,n){return new oR({type:"union",options:t,discriminator:e,...Le(n)})}const lR=ae("ZodIntersection",(e,t)=>{OC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>rI(e,n,r,s)});function ES(e,t){return new lR({type:"intersection",left:e,right:t})}const n0=ae("ZodRecord",(e,t)=>{LC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>sI(e,n,r,s),e.keyType=t.keyType,e.valueType=t.valueType});function zr(e,t,n){return!t||!t._zod?new n0({type:"record",keyType:R(),valueType:e,...Le(t)}):new n0({type:"record",keyType:e,valueType:t,...Le(n)})}const fd=ae("ZodEnum",(e,t)=>{jC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(r,s,i)=>Z2(e,r,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,s)=>{const i={};for(const o of r)if(n.has(o))i[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new fd({...t,checks:[],...Le(s),entries:i})},e.exclude=(r,s)=>{const i={...t.entries};for(const o of r)if(n.has(o))delete i[o];else throw new Error(`Key ${o} not found in enum`);return new fd({...t,checks:[],...Le(s),entries:i})}});function Oe(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new fd({type:"enum",entries:n,...Le(t)})}const uR=ae("ZodLiteral",(e,t)=>{MC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>X2(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ln(e,t){return new uR({type:"literal",values:Array.isArray(e)?e:[e],...Le(t)})}const cR=ae("ZodTransform",(e,t)=>{FC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>J2(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new G1(e.constructor.name);n.addIssue=i=>{if(typeof i=="string")n.issues.push(Ti(i,n.value,t));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Ti(o))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(i=>(n.value=i,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function SS(e){return new cR({type:"transform",transform:e})}const TS=ae("ZodOptional",(e,t)=>{uS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gS(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function r0(e){return new TS({type:"optional",innerType:e})}const dR=ae("ZodExactOptional",(e,t)=>{PC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>gS(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function pR(e){return new dR({type:"optional",innerType:e})}const fR=ae("ZodNullable",(e,t)=>{BC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>aI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function s0(e){return new fR({type:"nullable",innerType:e})}const mR=ae("ZodDefault",(e,t)=>{UC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>oI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function hR(e,t){return new mR({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():V1(t)}})}const gR=ae("ZodPrefault",(e,t)=>{$C.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>lI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function bR(e,t){return new gR({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():V1(t)}})}const NS=ae("ZodNonOptional",(e,t)=>{zC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>iI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function xR(e,t){return new NS({type:"nonoptional",innerType:e,...Le(t)})}const yR=ae("ZodCatch",(e,t)=>{HC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>uI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ER(e,t){return new yR({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const wS=ae("ZodPipe",(e,t)=>{cS.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>cI(e,n,r,s),e.in=t.in,e.out=t.out});function a0(e,t){return new wS({type:"pipe",in:e,out:t})}const SR=ae("ZodPreprocess",(e,t)=>{wS.init(e,t),GC.init(e,t)}),TR=ae("ZodReadonly",(e,t)=>{WC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>dI(e,n,r,s),e.unwrap=()=>e._zod.def.innerType});function NR(e){return new TR({type:"readonly",innerType:e})}const wR=ae("ZodCustom",(e,t)=>{qC.init(e,t),Dt.init(e,t),e._zod.processJSONSchema=(n,r,s)=>Q2(e,n)});function vR(e,t={}){return B2(wR,e,t)}function AR(e,t){return U2(e,t)}function Eo(e,t){return new SR({type:"pipe",in:SS(e),out:t})}const kR=se({id:R(),route:R(),retired:ln(!0).optional(),redirectTo:R().optional()}),_R=se({manifestVersion:K(),contributionApiVersion:K(),reactVersion:R(),reactDomVersion:R(),reactRouterVersion:R(),imports:zr(R(),R()),reservedModules:ke(kR)}),CR=xp("type",[se({id:R(),name:R(),icon:R(),type:ln("react"),route:R(),entryUrl:R(),styles:ke(R()),sidebarLabel:R().optional(),description:R().optional(),order:K().optional()}),se({id:R(),name:R(),icon:R(),type:ln("iframe"),route:R(),url:R(),sidebarLabel:R().optional(),description:R().optional(),order:K().optional()})]),IR=se({catalogVersion:ln(1),host:_R.nullable(),modules:ke(CR)}),RR={modules:ot.route({method:"GET",path:"/board/modules",summary:"Read the project Board module catalog",tags:["board"]}).output(IR)},Fn=["backlog","todo","wip","testing","blocked","done","cancelled"],da=["backlog","active","verifying","blocked","done","cancelled"],DR={backlog:"📋",todo:"🔲",wip:"🚧",testing:"🧪",blocked:"🚫",done:"✅",cancelled:"⛔"};function yp(e){try{return DR[AS(e)]??""}catch{return""}}const Kl=["P0","P1","P2","P3"],OR=["simple","standard","complex","research","refine","plan","unit","review","docs"],vS=["task","issue","review","meta","brainstorm"],Zl=["standard","feature-impl","issue","review","meta","brainstorm"],Ep=/^[A-Z][1-9]*$/,LR={completed:"done",complete:"done","in-progress":"wip","in progress":"wip",in_progress:"wip",dropped:"cancelled",cancel:"cancelled",canceled:"cancelled",new:"backlog",pending:"backlog",blocked:"blocked",wip:"wip",testing:"testing",done:"done",cancelled:"cancelled",backlog:"backlog",todo:"todo"};function AS(e){const t=e.trim().toLowerCase(),n=LR[t];if(n===void 0)throw new Error(`Unknown task status: ${JSON.stringify(e)} (allowed: ${Fn.join(", ")})`);return n}const ml=R().min(1).refine(e=>!Number.isNaN(Date.parse(e)),{message:"must be an ISO 8601 timestamp"}),kS=R().regex(Ep,{message:"feature id must match ^[A-Z][1-9]*$ (DD-14)"}).nullable().optional(),_S=R().regex(/^\d{4}$/,{message:"parent_wbs must be a 4-digit WBS string"}).nullable().optional();se({schema_version:ln(1),name:R().min(1),description:R().optional(),status:Eo(e=>{if(typeof e=="string")try{return AS(e)}catch{}return e},Oe(Fn)),type:Oe(vS).optional().default("task"),template:Oe(Zl).optional(),profile:Oe(OR).optional(),feature_id:kS,parent_wbs:_S,priority:Oe(Kl).optional(),tags:ke(R()).optional(),dependencies:ke(R()).optional(),ac_numbering:ln("task-local").optional(),ac_altitude:Oe(["graduating","task-local"]).optional(),done_forced:Eo(e=>typeof e=="string"?e==="true":e,$t().optional()),done_reason:R().optional(),feature_link_declined:Eo(e=>typeof e=="string"?e==="true":e,$t().optional()),estimate_hours:Eo(e=>typeof e=="string"&&e.trim()!==""?Number(e):e,K().positive().optional()),created_at:ml,updated_at:ml});se({schema_version:ln(1),id:R().regex(Ep,{message:"feature id must match ^[A-Z][1-9]*$ (DD-14)"}),name:R().min(1),status:Oe(da),priority:Oe(Kl).optional(),tags:ke(R()).optional(),created_at:ml,updated_at:ml});const jR=se({name:R().min(1,"name is required"),background:R().optional(),requirements:R().optional(),design:R().optional(),plan:R().optional(),acceptance_criteria:R().optional(),feature_id:kS,parent_wbs:_S,priority:Oe(Kl).optional(),tags:ke(R()).optional(),template:Oe(Zl).optional(),estimate_hours:K().positive().optional()}).strict();ke(jR).min(1,"batch must contain at least one task");const MR=["NOT_FOUND","VALIDATION_FAILED","GUARD_DENIED","LOCK_TIMEOUT","CONFLICT","INTERNAL_ERROR"];function Nt(e){return se({ok:ln(!0),data:e})}se({ok:ln(!1),error:se({code:Oe(MR),message:R(),details:Pr().optional()})});se({nextCursor:R().optional(),hasMore:$t(),limit:K().int().positive()});const Rn=R().regex(Ep,{message:"feature id must match ^[A-Z][1-9]*$ (DD-14)"}),FR=se({id:Rn,name:R().min(1),status:Oe(da),priority:Oe(Kl).optional(),parentId:Rn.nullable().optional(),wbsCount:K().int().nonnegative().optional()}),PR=Nt(ke(FR)),BR=Nt(se({id:Rn,name:R(),status:Oe(da),frontmatter:zr(R(),Pr()),content:R(),filePath:R()})),UR=se({id:Rn}),$R=se({name:R().min(1),parentId:Rn.optional()}),zR=Nt(se({id:R(),filePath:R()})),HR=se({id:Rn,toStatus:Oe(da),actor:R().optional()}),GR=Nt(se({id:R(),status:Oe(da)})),WR=se({id:Rn,body:R(),actor:R().optional()}),qR=Nt(se({})),VR=Oe(["brainstorm","plan"]),YR=Oe(["claude","codex","gemini","pi","opencode","antigravity","openclaw"]),KR=se({id:Rn,action:VR,channel:YR.optional(),skipDeps:$t().optional()}),ZR=se({runId:R(),action:R(),status:ln("queued")}),XR=Nt(ZR),QR=se({id:Rn,name:R().min(1)}),JR=Nt(se({id:R(),filePath:R()})),eD=se({id:Rn,title:R().min(1)}),tD=Nt(se({wbs:R(),filePath:R()})),nD=se({id:Rn,wbs:R().regex(/^\d{4}$/)}),rD=Nt(se({})),CS=Oe(["pull","push"]),sD=se({id:Rn,direction:CS}),aD=Nt(se({direction:CS,affectedTasks:K().int().nonnegative(),applied:$t(),newStatus:R().optional()})),iD={list:ot.route({method:"GET",path:"/features",summary:"List features",tags:["feature"]}).output(PR),show:ot.route({method:"GET",path:"/features/{id}",summary:"Show feature detail",tags:["feature"]}).input(UR).output(BR),create:ot.route({method:"POST",path:"/features",summary:"Create a feature",tags:["feature"]}).input($R).output(zR),transition:ot.route({method:"PATCH",path:"/features/{id}/status",summary:"Transition feature status",tags:["feature"]}).input(HR).output(GR),refresh:ot.route({method:"POST",path:"/features/refresh",summary:"Refresh feature index and kanban",tags:["feature"]}).output(Nt(se({rebuilt:K().int().nonnegative(),skipped:ke(se({id:R(),reason:R()}))}))),check:ot.route({method:"POST",path:"/features/{id}/check",summary:"Run the four-layer feature check",tags:["feature"]}).input(se({id:Rn})).output(Nt(se({id:R(),status:R(),pass:$t(),findings:ke(se({layer:Oe(["L1","L2","L3","L4"]),severity:Oe(["error","warning","info"]),section:R(),message:R()})),requiredSections:ke(R()),missingSections:ke(R())}))),body:ot.route({method:"PATCH",path:"/features/{id}/body",summary:"Update feature body",tags:["feature"]}).input(WR).output(qR),action:ot.route({method:"POST",path:"/features/{id}/action",summary:"Run a feature workflow action",tags:["feature"]}).input(KR).output(XR),children:ot.route({method:"POST",path:"/features/{id}/children",summary:"Create a child feature",tags:["feature"]}).input(QR).output(JR),tasks:ot.route({method:"POST",path:"/features/{id}/tasks",summary:"Create a task linked to feature",tags:["feature"]}).input(eD).output(tD),link:ot.route({method:"PATCH",path:"/features/{id}/link",summary:"Link an existing task to feature",tags:["feature"]}).input(nD).output(rD),sync:ot.route({method:"POST",path:"/features/{id}/sync",summary:"Sync feature status with linked tasks",tags:["feature"]}).input(sD).output(aD)},IS=se({mode:Oe(["persistent","resume","one-shot"]),id:R().optional()}),oD=se({instanceId:R(),role:R().optional(),executor:R(),model:R().optional(),enabled:$t(),writeCapable:$t(),capabilityState:R(),session:IS.optional()}),lD=se({path:R().nullable(),enabled:$t(),strategy:se({name:R(),version:K()}).nullable(),orchestrator:se({state:Oe(["bound-online","bound-offline","missing","unresolvable"]),instanceId:R().optional(),holderId:R().optional(),reason:R().optional()}),members:ke(oD),capacity:se({total:K(),enabled:K(),writeCapable:K(),missing:ke(R())})}),uD=se({agentId:R(),pid:K().nullable(),status:Oe(["running","stopped","exited","errored"]),startedAt:R(),exitCode:K().nullable(),teamId:eR(),session:IS.optional()}),cD=se({id:R(),label:R(),command:R(),args:ke(R()),pid:K().nullable(),status:R(),startedAt:R(),exitedAt:R().nullable(),exitCode:K().nullable(),source:R(),teamId:R().nullable(),agentId:R().nullable()}),dD=se({processes:ke(uD),count:K(),executions:ke(cD),executionsCount:K()});se({name:R(),agent:R(),model:R().optional(),tier:R(),disabled:$t(),disabledOwner:R().optional(),disabledReason:R().optional(),disabledSince:R().optional(),installed:$t().optional(),usable:$t().optional(),version:R().nullable().optional(),error:R().nullable().optional(),elected:ke(R()).optional(),executionCapabilities:zr(R(),Pr()).optional(),sourceLayer:Oe(["project","global"]).optional(),sourcePath:R().optional()});se({id:R(),alias:R().optional(),description:R(),role:R(),tier:R(),skill:R().optional(),electedExecutor:R().nullable().optional(),candidateExecutors:ke(R()).optional()});const pD=se({name:R(),disabled:$t(),layer:Oe(["project","global"]).optional()}),fD=se({ok:$t(),status:Oe(["updated","unchanged"]),reason:R().optional(),targetLayer:Oe(["project","global"]).optional(),targetPath:R().optional()}),mD={snapshot:ot.route({method:"GET",path:"/project/fleet",summary:"Read the project fleet snapshot (declared roster + runtime session state)",tags:["fleet"]}).output(lD),setExecutorAvailability:ot.route({method:"POST",path:"/project/executors/availability",summary:"Toggle an executor availability state (Ready / Disabled) in project or global config",tags:["fleet"]}).input(pD).output(fD)},hD={list:ot.route({method:"GET",path:"/processes",summary:"List supervised agent processes and registry executions",tags:["processes"]}).output(dD)},i0=se({path:R(),displayPath:R(),exists:$t(),content:R(),sizeBytes:K(),updatedAt:R().nullable()}),gD=se({global:i0,project:i0});ot.route({method:"GET",path:"/project/configs",summary:"Read Spur project and global configuration files with raw YAML content",tags:["fleet"]}).output(gD);const bD=se({name:R(),kind:R(),version:R().nullable(),description:R().nullable(),path:R(),source:Oe(["project","registered","shared"]),valid:$t(),error:R().optional(),rawYaml:R(),mermaidDiagram:R()}),xD=se({workflows:ke(bD),total:K()});ot.route({method:"GET",path:"/project/workflows",summary:"List registered and available Spur workflows with raw YAML and Mermaid diagram definitions",tags:["fleet"]}).output(xD);const yD=Oe(["1h","4h","24h","7d","30d","all","custom"]),ED=Oe(["auto","1m","3m","5m","10m","30m","1h","4h","1d"]),SD=Oe(["model","source","tool","skill"]),Ni=se({range:yD.default("4h"),from:R().datetime().optional(),to:R().datetime().optional(),sources:ke(R()).optional(),models:ke(R()).optional(),tools:ke(R()).optional(),skills:ke(R()).optional(),bucket:ED.default("auto"),dimension:SD.default("model")}),Xl=se({billedTokens:K(),cacheSavedTokens:K(),cacheReadTokens:K(),freshInputTokens:K(),outputTokens:K()}),o0=se({totalBilledTokens:K(),cacheSavedTokens:K(),cacheSavedPercent:K(),sessionsCount:K(),toolCallsCount:K(),errorRate:K()}),TD=se({day:R(),totalBilledTokens:K(),cacheSavedTokens:K(),sessionsCount:K(),toolCallsCount:K(),cacheHitRatio:K()}),Ds=se({bucketStart:R(),cacheHitRatio:K(),gainRatio:K().optional(),series:zr(R(),K())}),l0=se({id:R(),label:R(),color:R(),tokens:K(),share:K(),freshInputTokens:K().optional(),cacheReadTokens:K().optional(),outputTokens:K().optional()}),ND=se({id:R(),count:K(),errors:K(),errorRate:K(),durationMs:K().optional(),tokens:K().optional(),usageShare:K().optional(),timeShare:K().optional(),tokenShare:K().optional()}),wD=se({id:R(),label:R(),color:R(),count:K()}),vD=se({bySkill:ke(se({skillName:R(),calls:K()})),bySource:ke(se({source:R(),calls:K()})),byInvocationKind:ke(se({invocationKind:R(),calls:K()})),trend:ke(Ds),fresh:$t().default(!0)}),AD=se({source:R(),sourceName:R(),color:R(),hitRatio:K(),savedTokens:K(),freshTokens:K(),totalRead:K(),billedTokens:K()}),kD=se({model:R(),modelName:R(),color:R(),hitRatio:K(),savedTokens:K(),freshTokens:K(),totalRead:K(),billedTokens:K()}),_D=se({source:R(),sourceName:R(),model:R(),modelName:R(),color:R(),hitRatio:K(),savedTokens:K(),totalRead:K(),billedTokens:K()}),CD=se({hitRatio:K(),savedTokens:K(),totalRead:K(),bySource:ke(AD).optional(),byModel:ke(kD).optional(),byAgentModel:ke(_D).optional()}),ID=se({kpis:o0,timeSeries:ke(Ds),topModels:ke(l0),topSources:ke(l0),topTools:ke(ND),skillsUsed:ke(wD),skillBreakdown:vD,cacheEfficiency:CD,kpiTrend:ke(TD),previousKpis:o0.nullable(),skillTimeSeries:ke(Ds),modelTimeSeries:ke(Ds).optional(),sourceTimeSeries:ke(Ds).optional(),toolTimeSeries:ke(Ds).optional()}),RD=Nt(ID),DD=Oe(["read","write","bash","search","run","user","assistant","unknown"]),RS=Oe(["measured","inferred","unmeasured"]),OD=Oe(["exact","estimated"]),LD=xp("mode",[se({mode:ln("session"),source:R().min(1),sessionId:R().min(1)}),se({mode:ln("consolidated"),filter:Ni.optional(),taskWbs:R().optional(),runId:R().optional()})]),jD=se({seq:K(),eventType:Oe(["message","tool"]),kind:DD,title:R(),toolName:R().nullable(),durationMs:K().nullable(),durationSource:RS,tokens:K(),freshInputTokens:K(),cacheReadTokens:K(),outputTokens:K(),promptTokens:Xl.nullable(),exitCode:K().nullable(),payload:R().nullable(),agent:R(),model:R()}),MD=se({key:R(),sessionId:R(),turnIndex:K(),timestamp:R().nullable(),source:R(),model:R(),correlationExactness:OD.nullable(),totalDurationMs:K(),totalTokens:K(),operationCount:K(),events:ke(jD)}),FD=se({sessionId:R().nullable(),source:R().nullable(),model:R().nullable(),start:R().nullable(),end:R().nullable(),durationMs:K(),tokens:Xl,messageCount:K(),toolCallCount:K(),sessionCount:K()}),PD=se({mode:Oe(["session","consolidated"]),scope:FD,truncated:$t(),blocks:ke(MD)}),BD=Nt(PD),UD=se({id:R(),source:R(),model:R(),modelDetail:R().optional(),start:R(),durationMs:K(),messages:K(),toolCalls:K(),billedTokens:K(),cacheReadTokens:K(),freshInputTokens:K(),outputTokens:K(),topTool:R(),state:R()}),$D=se({items:ke(UD),total:K(),page:K(),pageSize:K()}),zD=Nt($D),HD=se({filter:Ni.optional(),page:K().int().min(1).default(1),pageSize:K().int().min(1).max(100).default(20),sortBy:Oe(["start","duration","messages","toolCalls","billedTokens","cacheRead","freshInput"]).default("start"),sortDir:Oe(["asc","desc"]).default("desc")}),GD=Oe(["read","write","bash","search","mcp","other"]),WD=Oe(["all","ok","error"]),DS=se({seq:K(),toolSeq:K(),ts:R().nullable(),toolName:R(),category:GD,status:Oe(["ok","error","unknown"]),durationMs:K().nullable(),durationSource:RS,resultBytes:K().nullable(),argsRaw:R().nullable(),argsDigest:R().nullable(),errorText:R().nullable(),callId:R().nullable(),messageHash:R(),sessionId:R(),source:R(),model:R().nullable(),tokens:Xl}),qD=se({sessionId:R().nullable(),source:R().nullable(),model:R().nullable(),start:R().nullable(),end:R().nullable(),totalCalls:K(),uniqueTools:K(),errorCount:K(),errorRate:K(),totalDurationMs:K(),meanDurationMs:K(),durationUnmeasured:K(),sessionCount:K(),tokens:Xl}),VD=ES(xp("mode",[se({mode:ln("session"),source:R().min(1),sessionId:R().min(1)}),se({mode:ln("consolidated"),filter:Ni.optional()})]),se({toolNames:ke(R()).optional(),status:WD.default("all"),search:R().optional()})),YD=se({mode:Oe(["session","consolidated"]),scope:qD,truncated:$t(),items:ke(DS)}),KD=Nt(YD),ZD=se({tool:R(),argsHint:R(),sessionId:R(),repeats:K(),fromSeq:K(),toSeq:K(),wastedTokens:K(),repeatedCalls:ke(DS).optional()}),XD=se({sessionId:R(),timestamp:R(),freshTokens:K(),reason:R()}),QD=se({id:R(),source:R(),model:R(),tokens:K(),durationMs:K()}),u0=se({stepIndex:K(),sessionId:R(),toolName:R(),tokens:K(),durationMs:K().optional(),agent:R(),model:R()}),JD=se({model:R(),speedMsMean:K(),cacheRatio:K(),reliability:K(),outputRatio:K()}),eO=se({loops:ke(ZD),cacheWaste:ke(XD),heavySessions:ke(QD),largestTokenSteps:ke(u0),slowSteps:ke(u0),modelComparison:ke(JD)}),tO=Nt(eO),nO=se({date:R(),tokens:K(),sessions:K()}),rO=se({id:R(),name:R(),color:R(),importPath:R(),filePattern:R(),filesCount:K(),sizeMb:K().nullable(),sessionCount:K(),totalTokens:K(),cacheSavedTokens:K(),freshTokens:K(),toolCalls:K(),firstDate:R().nullable(),lastDate:R().nullable(),heatmapDays:ke(nO),maxDailyTokens:K()}),sO=se({agentId:R(),agentName:R(),path:R(),matchPattern:R(),fileCount:K(),status:Oe(["active","empty","missing"])}),aO=se({totalFiles:K(),corpusSizeBytes:K(),dateCoverage:se({from:R().nullable(),to:R().nullable()}),totalSessions:K(),lastImportedAt:R().nullable()}),iO=se({overview:aO,agents:ke(rO),roots:ke(sO)}),oO=Nt(iO),lO=se({mode:Oe(["full","incremental"]).default("incremental")}),uO=se({runId:R(),status:Oe(["queued","coalesced","already-running"]),message:R()}),cO=Nt(uO),dO={getSummary:ot.route({method:"POST",path:"/history/summary",summary:"Get conversation history analytics summary",tags:["history"]}).input(Ni.optional()).output(RD),getTimeline:ot.route({method:"POST",path:"/history/timeline",summary:"Get chronological session or consolidated execution timeline",tags:["history"]}).input(LD).output(BD),getToolSequence:ot.route({method:"POST",path:"/history/tool-sequence",summary:"Get ordered tool invocation sequence for a session or filtered scope",tags:["history"]}).input(VD).output(KD),getSessions:ot.route({method:"POST",path:"/history/sessions",summary:"List and filter conversation sessions",tags:["history"]}).input(HD).output(zD),getInsights:ot.route({method:"POST",path:"/history/insights",summary:"Get conversation forensic insights and loops",tags:["history"]}).input(Ni.optional()).output(tO),getSources:ot.route({method:"GET",path:"/history/sources",summary:"Get all-time agent sources overview and heatmaps",tags:["history"]}).output(oO),triggerImport:ot.route({method:"POST",path:"/history/import",summary:"Trigger history transcript import and analysis",tags:["history"]}).input(lO).output(cO)},pO=Nt(se({eventName:R(),occurredAt:R().datetime(),actor:R().nullable().optional(),payload:zr(R(),Pr())})),fO={stream:ot.route({method:"GET",path:"/events/planning",summary:"Stream planning events (SSE)",tags:["events"]}).output(pO)},mO=se({wbs:R().regex(/^\d{4}$/),name:R().min(1),status:Oe(Fn),priority:R().optional(),featureId:R().nullable().optional(),parentWbs:R().regex(/^\d{4}$/).nullable().optional(),type:Oe(vS).optional(),template:R().optional(),estimateHours:K().optional(),dependencyCount:K().optional(),filePath:R(),updatedAt:R().optional()}),hO=Nt(ke(mO)),gO=se({folder:R().optional(),status:R().optional(),parent:R().optional()}),bO=Nt(se({wbs:R(),name:R(),status:Oe(Fn),frontmatter:zr(R(),Pr()),content:R(),filePath:R()})),xO=se({wbs:R().regex(/^\d{4}$/)}),yO=se({title:R().min(1),featureId:R().optional(),parentWbs:R().regex(/^\d{4}$/).optional(),folder:R().optional(),template:Oe(Zl).optional()}),EO=Nt(se({wbs:R(),filePath:R()})),SO=se({wbs:R().regex(/^\d{4}$/),toStatus:Oe(Fn),actor:R().optional()}),TO=Nt(se({wbs:R(),status:Oe(Fn)})),NO=se({wbs:R().regex(/^\d{4}$/),body:R(),actor:R().optional()}),wO=Nt(se({wbs:R(),filePath:R()})),vO=Oe(["claude","codex","gemini","pi","opencode","antigravity","openclaw"]),AO=Oe(["refine","plan","run","verify","decompose","evaluate"]),kO=se({wbs:R().regex(/^\d{4}$/),action:AO,channel:vO.optional(),skipDeps:$t().optional()}),_O=Nt(se({runId:R(),action:R(),status:ln("queued")})),CO=se({path:R(),label:R().optional()}),IO=Nt(ke(CO)).extend({activeFolder:R().optional()}),RO={list:ot.route({method:"GET",path:"/tasks",summary:"List tasks",tags:["task"]}).input(gO).output(hO),folders:ot.route({method:"GET",path:"/tasks/folders",summary:"List configured task folders",tags:["task"]}).output(IO),show:ot.route({method:"GET",path:"/tasks/{wbs}",summary:"Show task detail",tags:["task"]}).input(xO).output(bO),create:ot.route({method:"POST",path:"/tasks",summary:"Create a task",tags:["task"]}).input(yO).output(EO),transition:ot.route({method:"PATCH",path:"/tasks/{wbs}/status",summary:"Transition task status",tags:["task"]}).input(SO).output(TO),body:ot.route({method:"PATCH",path:"/tasks/{wbs}/body",summary:"Update task body",tags:["task"]}).input(NO).output(wO),action:ot.route({method:"POST",path:"/tasks/{wbs}/actions",summary:"Run a task action",tags:["task"]}).input(kO).output(_O)},DO=se({totalEvents:K(),activeJobs:K(),completedJobs:K(),failedJobs:K(),successRatePct:K(),errorEventCount:K(),warningEventCount:K()}),OO=se({timestamp:R(),total:K(),byPrefix:zr(R(),K()),bySeverity:se({info:K(),warning:K(),error:K(),unknown:K()})}),LO=se({name:R(),prefix:R(),count:K(),latestAt:R(),avgDurationMs:K().nullable(),failureCount:K()}),jO=se({id:R(),source:Oe(["event","job"]),name:R(),occurredAt:R(),message:R(),refId:R().optional()});se({window:se({since:R(),until:R(),range:R()}),kpis:DO,eventVolumeBuckets:ke(OO),topEventTypes:ke(LO),recentErrors:ke(jO)});const MO=Oe(["pending","processing","completed","failed"]),FO=se({id:R(),type:R(),status:MO,attempts:K(),maxRetries:K(),queuedAt:R(),startedAt:R().nullable(),endedAt:R().nullable(),durationMs:K().nullable(),lastError:R().nullable(),payload:zr(R(),Pr()).nullable()}),PO=se({all:K(),pending:K(),processing:K(),completed:K(),failed:K()});se({jobs:ke(FO),total:K(),hasMore:$t(),countsByStatus:PO});const BO=Oe(["completed","failed","processing","none"]),UO=se({name:R(),cron:R(),cadence:R(),nextFireAt:R().nullable(),lastFiredAt:R().nullable(),lastStatus:BO,source:Oe(["builtin","config"])});se({schedules:ke(UO)});const $O=se({status:ln("ok"),timestamp:R(),service:ln("spur"),version:R()}),zO={health:ot.route({method:"GET",path:"/health",summary:"Read application health",tags:["system"]}).output($O),task:{...RO},board:{...RR},feature:{...iD},history:{...dO},fleet:{...mD},processes:{...hD},...fO};class HO extends z1{initRuntimeAdapter(t){for(const n of this.plugins)n.initRuntimeAdapter?.(t)}}class GO{fetch;toFetchRequestOptions;adapterInterceptors;constructor(t){new HO(t.plugins).initRuntimeAdapter(t),this.fetch=t.fetch??globalThis.fetch.bind(globalThis),this.toFetchRequestOptions=t,this.adapterInterceptors=ul(t.adapterInterceptors)}async call(t,n,r,s){const i=kk(t,this.toFetchRequestOptions),o=await od(this.adapterInterceptors,{...n,request:i,path:r,input:s,init:{redirect:"manual"}},({request:u,path:c,input:d,init:p,...f})=>this.fetch(u,p,f,c,d));return _k(o,{signal:i.signal})}}class WO{maxArrayIndex;constructor(t={}){this.maxArrayIndex=t.maxBracketNotationArrayIndex??9999}serialize(t,n=[],r=[]){if(Array.isArray(t))t.forEach((s,i)=>{this.serialize(s,[...n,i],r)});else if(Lr(t))for(const s in t)this.serialize(t[s],[...n,s],r);else r.push([this.stringifyPath(n),t]);return r}deserialize(t){if(t.length===0)return{};const n=new WeakSet,r={value:[]};for(const[s,i]of t){const o=this.parsePath(s);let l=r,u="value";o.forEach((c,d)=>{!Array.isArray(l[u])&&!Lr(l[u])&&(l[u]=[]),d!==o.length-1?Array.isArray(l[u])&&!c0(c,this.maxArrayIndex)&&(n.has(l[u])?(n.delete(l[u]),l[u]=d0(l[u])):l[u]=Ju(l[u])):Array.isArray(l[u])&&(c===""?l[u].length&&!n.has(l[u])&&(l[u]=Ju(l[u])):n.has(l[u])?(n.delete(l[u]),l[u]=d0(l[u])):c0(c,this.maxArrayIndex)||(l[u]=Ju(l[u]))),l=l[u],u=c}),Array.isArray(l)&&u===""?(n.add(l),l.push(i)):u in l?Array.isArray(l[u])?l[u].push(i):l[u]=[l[u],i]:l[u]=i}return r.value}stringifyPath(t){return t.map(n=>n.toString().replace(/[\\[\]]/g,r=>{switch(r){case"\\":return"\\\\";case"[":return"\\[";case"]":return"\\]";default:return r}})).reduce((n,r,s)=>s===0?r:`${n}[${r}]`,"")}parsePath(t){const n=[];let r=!1,s="",i=0;for(let o=0;o<t.length;o++){const l=t[o],u=t[o+1];r&&l==="]"&&(u===void 0||u==="[")&&i%2===0?(u===void 0&&(r=!1),n.push(s),s="",o++):n.length===0&&l==="["&&i%2===0?(r=!0,n.push(s),s=""):l==="\\"?i++:(s+="\\".repeat(i/2)+l,i=0)}return r||n.length===0?[t]:n}}function c0(e,t){return/^0$|^[1-9]\d*$/.test(e)&&Number(e)<=t}function Ju(e){const t=new I1;return e.forEach((n,r)=>{t[r]=n}),t}function d0(e){const t=new I1;return t[""]=e.length===1?e[0]:e,t}class qO{customSerializers;constructor(t={}){this.customSerializers=t.customJsonSerializers??[]}serialize(t,n={value:!1}){for(const r of this.customSerializers)if(r.condition(t))return this.serialize(r.serialize(t),n);if(t instanceof Blob)return n.value=!0,[t,n.value];if(t instanceof Set)return this.serialize(Array.from(t),n);if(t instanceof Map)return this.serialize(Array.from(t.entries()),n);if(Array.isArray(t))return[t.map(s=>s===void 0?null:this.serialize(s,n)[0]),n.value];if(Lr(t)){const r={};for(const s in t)s==="toJSON"&&typeof t[s]=="function"||(r[s]=this.serialize(t[s],n)[0]);return[r,n.value]}return typeof t=="bigint"||t instanceof RegExp||t instanceof URL?[t.toString(),n.value]:t instanceof Date?[Number.isNaN(t.getTime())?null:t.toISOString(),n.value]:Number.isNaN(t)?[null,n.value]:[t,n.value]}}function md(e){return`/${e.replace(/\/{2,}/g,"/").replace(/^\/|\/$/g,"")}`}function p0(e){return e?md(e).match(/\/\{[^}]+\}/g)?.map(t=>({raw:t,name:t.match(/\{\+?([^}]+)\}/)[1]})):void 0}class VO{constructor(t,n,r){this.contract=t,this.serializer=n,this.baseUrl=r.url,this.headers=r.headers??{},this.customErrorResponseBodyDecoder=r.customErrorResponseBodyDecoder}baseUrl;headers;customErrorResponseBodyDecoder;async encode(t,n,r){let s=Ik(await Dx(this.headers,r,t,n));r.lastEventId!==void 0&&(s=Ox(s,{"last-event-id":r.lastEventId}));const i=await Dx(this.baseUrl,r,t,n),o=Rx(this.contract,t);if(!cd(o))throw new Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${t.join(".")}`);return go("defaultInputStructure",o["~orpc"].route.inputStructure)==="compact"?this.#e(o,t,n,r,i,s):this.#t(o,t,n,r,i,s)}#e(t,n,r,s,i,o){let l=md(t["~orpc"].route.path??jx(n)),u=r;const c=p0(l);if(c?.length){if(!Lr(r))throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "compact" structure when has dynamic params at ${n.join(".")}.`);const f={...r};for(const m of c){const b=r[m.name];l=l.replace(m.raw,`/${encodeURIComponent(`${this.serializer.serialize(b)}`)}`),delete f[m.name]}u=Object.keys(f).length?f:void 0}const d=go("defaultMethod",t["~orpc"].route.method),p=new URL(i);if(p.pathname=`${p.pathname.replace(/\/$/,"")}${l}`,d==="GET"){const f=this.serializer.serialize(u,{outputFormat:"URLSearchParams"});for(const[m,b]of f)p.searchParams.append(m,b);return{url:p,method:d,headers:o,body:void 0,signal:s.signal}}return{url:p,method:d,headers:o,body:this.serializer.serialize(u),signal:s.signal}}#t(t,n,r,s,i,o){let l=md(t["~orpc"].route.path??jx(n));const u=p0(l);if(!Lr(r)&&r!==void 0)throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input shape for "detailed" structure at ${n.join(".")}.`);if(u?.length){if(!Lr(r?.params))throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input.params shape for "detailed" structure when has dynamic params at ${n.join(".")}.`);for(const f of u){const m=r.params[f.name];l=l.replace(f.raw,`/${encodeURIComponent(`${this.serializer.serialize(m)}`)}`)}}let c=o;if(r?.headers!==void 0){if(!Lr(r.headers))throw new TypeError(`[StandardOpenapiLinkCodec] Invalid input.headers shape for "detailed" structure at ${n.join(".")}.`);c=Ox(r.headers,o)}const d=go("defaultMethod",t["~orpc"].route.method),p=new URL(i);if(p.pathname=`${p.pathname.replace(/\/$/,"")}${l}`,r?.query!==void 0){const f=this.serializer.serialize(r.query,{outputFormat:"URLSearchParams"});for(const[m,b]of f)p.searchParams.append(m,b)}return d==="GET"?{url:p,method:d,headers:c,body:void 0,signal:s.signal}:{url:p,method:d,headers:c,body:this.serializer.serialize(r?.body),signal:s.signal}}async decode(t,n,r){const s=!yi(t.status),i=await(async()=>{let u=!1;try{const c=await t.body();return u=!0,this.serializer.deserialize(c)}catch(c){throw u?new Error("Invalid OpenAPI response format.",{cause:c}):new Error("Cannot parse response body, please check the response body and content-type.",{cause:c})}})();if(!s){const u=this.customErrorResponseBodyDecoder?.(i,t);throw u??(O1(i)?L1(i):new xi(Rk(t.status),{status:t.status,data:{...t,body:i}}))}const o=Rx(this.contract,r);if(!cd(o))throw new Error(`[StandardOpenapiLinkCodec] expect a contract procedure at ${r.join(".")}`);return go("defaultOutputStructure",o["~orpc"].route.outputStructure)==="compact"?i:{status:t.status,headers:t.headers,body:i}}}class YO{constructor(t,n){this.jsonSerializer=t,this.bracketNotation=n}serialize(t,n={}){return bi(t)&&!n.outputFormat?Lx(t,{value:async r=>this.#e(r,{outputFormat:"plain"}),error:async r=>new Ei({data:this.#e(dk(r).toJSON(),{outputFormat:"plain"}),cause:r})}):this.#e(t,n)}#e(t,n){const[r,s]=this.jsonSerializer.serialize(t);if(n.outputFormat==="plain")return r;if(n.outputFormat==="URLSearchParams"){const o=new URLSearchParams;for(const[l,u]of this.bracketNotation.serialize(r))(typeof u=="string"||typeof u=="number"||typeof u=="boolean")&&o.append(l,u.toString());return o}if(r instanceof Blob||r===void 0||!s)return r;const i=new FormData;for(const[o,l]of this.bracketNotation.serialize(r))typeof l=="string"||typeof l=="number"||typeof l=="boolean"?i.append(o,l.toString()):l instanceof Blob&&i.append(o,l);return i}deserialize(t){return t instanceof URLSearchParams||t instanceof FormData?this.bracketNotation.deserialize(Array.from(t.entries())):bi(t)?Lx(t,{value:async n=>n,error:async n=>n instanceof Ei&&O1(n.data)?L1(n.data,{cause:n}):n}):t}}class KO extends Ck{constructor(t,n,r){const s=new qO(r),i=new WO({maxBracketNotationArrayIndex:4294967294}),o=new YO(s,i),l=new VO(t,o,r);super(l,n,r)}}class ZO extends KO{constructor(t,n){const r=new GO(n);super(t,r,n)}}function nt(e=void 0,t=globalThis.location?.origin,n=!1){return e||(t&&t!=="null"?new URL("/api",t).toString():"http://localhost:3000/api")}function Ge(e,t=1e4){const n=new AbortController,r=setTimeout(()=>n.abort(),t),s=e.signal,i=()=>n.abort(s.reason);s.aborted?i():s.addEventListener("abort",i,{once:!0});const o=new Request(e,{signal:n.signal});return fetch(o).finally(()=>{clearTimeout(r),s.removeEventListener("abort",i)})}function XO(e){return Ge(e)}function QO(e){typeof globalThis<"u"&&globalThis.dispatchEvent&&globalThis.dispatchEvent(new CustomEvent("api-error",{detail:{message:e instanceof Error?e.message:String(e)}}))}const Pt=B1(new ZO(zO,{url:nt(),fetch:XO,adapterInterceptors:[nk(QO)]})),JO={display:"flex",flexDirection:"column",flex:"1 1 auto",minWidth:0,minHeight:0,height:"100%"},eL={flex:"1 1 auto",minWidth:0,minHeight:0,width:"100%",border:"0",display:"block"};function tL({moduleId:e,url:t,title:n}){return a.jsxs("div",{className:"framed-resource","data-testid":"framed-resource","data-module-id":e,"data-framed-url":t,style:JO,children:[a.jsx("div",{className:"flex items-center justify-end gap-2 border-b border-spur-border bg-spur-surface px-3 py-1",children:a.jsx("a",{className:"text-xs font-medium text-spur-text underline underline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-spur-accent","data-testid":"framed-resource-external",href:t,target:"_blank",rel:"noopener noreferrer",children:"Open externally"})}),a.jsx("iframe",{className:"framed-resource-frame","data-testid":"framed-resource-frame",src:t,title:n,style:eL})]})}const nL={catalog:"The project module catalog could not be read.",import:"Its compiled browser entry did not load (timed out or failed).",style:"Its stylesheet did not load, so it was not displayed.",export:"Its entry did not publish a usable Board contribution.",version:"It targets a contribution API version this Board does not support.",render:"It failed while rendering.",panel:"Its right panel failed while rendering.",unsupported:"This Board build cannot render this contribution type yet."};function OS(e){return e.replace(/(?:^|[\s("'])\/[\w.@%+-]+\/[\w.@%+/-]+/g," [redacted path]")}function LS({diagnostic:e}){return a.jsxs("div",{role:"alert","data-testid":"module-diagnostic","data-module-id":e.moduleId,"data-failure-category":e.category,className:"m-4 rounded-md border border-spur-border bg-spur-surface p-4 text-sm text-spur-text",children:[a.jsxs("p",{className:"font-semibold",children:["“",e.moduleId,"” could not be displayed."]}),a.jsx("p",{className:"mt-1 text-spur-text-muted",children:nL[e.category]}),a.jsxs("p",{className:"mt-1 font-mono text-xs text-spur-text-muted",children:[e.category,": ",OS(e.message)]}),a.jsx("p",{className:"mt-1 text-spur-text-muted",children:"Reload this page after fixing the project module configuration. Other modules stay usable."})]})}function rL({diagnostics:e}){return e.length===0?null:a.jsx("div",{role:"status","data-testid":"board-diagnostics",className:"border-b border-spur-border bg-spur-surface px-4 py-2 text-xs text-spur-text",children:e.map(t=>a.jsxs("p",{children:[t.moduleId,": ",OS(t.message)]},`${t.moduleId}:${t.category}`))})}class jS extends g.Component{state={error:null};static getDerivedStateFromError(t){return{error:t}}render(){const{error:t}=this.state;return t?a.jsx(LS,{diagnostic:{moduleId:this.props.moduleId,category:this.props.category??"render",message:t.message}}):this.props.children}}const sL=1e4;function aL(e){return import(e)}const f0=new Set,So=new Map;function iL(e){if(f0.has(e))return Promise.resolve();const t=So.get(e);if(t)return t;const n=new Promise((r,s)=>{const i=document.createElement("link");i.rel="stylesheet",i.href=e,i.addEventListener("load",()=>{f0.add(e),So.delete(e),r()}),i.addEventListener("error",()=>{So.delete(e),s(new Error(`stylesheet failed to load: ${e}`))}),document.head.append(i)});return So.set(e,n),n}function m0(e,t,n){return new Promise((r,s)=>{const i=setTimeout(()=>s(new Error(`${n} exceeded ${t}ms`)),t);e.then(o=>{clearTimeout(i),r(o)},o=>{clearTimeout(i),s(o instanceof Error?o:new Error(String(o)))})})}function oL(e){return e.route.replace(/^\//,"").replace(/\/$/,"")}function lL(e,t){return{...Sp(e),component:()=>g.createElement(LS,{diagnostic:t}),contributionType:e.type}}function Sp(e){return{id:e.id,name:e.name,icon:e.icon,route:oL(e),sidebarLabel:e.sidebarLabel,description:e.description,order:e.order}}function uL(e,t,n){const r=e?.webModule;if(r===null||typeof r!="object")return{moduleId:t.id,category:"export",message:'named export "webModule" is missing'};const{apiVersion:s,component:i}=r;return s!==n?{moduleId:t.id,category:"version",message:`contribution apiVersion ${String(s)} is not supported (host ${n})`}:typeof i!="function"?{moduleId:t.id,category:"export",message:"webModule.component is not a component"}:r}function MS(e){return"category"in e}async function cL(e,t,n){for(const i of e.styles)try{await m0(n.loadStyle(i),n.timeoutMs,"stylesheet load")}catch(o){return{moduleId:e.id,category:"style",message:o instanceof Error?o.message:String(o)}}let r;try{r=await m0(n.importEntry(e.entryUrl),n.timeoutMs,"entry import")}catch(i){return{moduleId:e.id,category:"import",message:i instanceof Error?i.message:String(i)}}const s=uL(r,e,t);return MS(s)?s:{...Sp(e),component:s.component,rightPanelComponent:s.rightPanelComponent,contributionType:"react"}}async function dL(e,t,n={}){const r=n.loadTimeoutMs??sL,s=n.importEntry??aL,i=n.loadStyle??iL;if(!e)return{modules:t,hostDiagnostics:[{moduleId:"catalog",category:"catalog",message:"the project module catalog could not be read"}]};if(!e.host)return{modules:t,hostDiagnostics:[{moduleId:"catalog",category:"unsupported",message:"no Board web distribution is installed, so downstream modules cannot be rendered"}]};const o=e.host.contributionApiVersion,l=[...e.modules].sort((c,d)=>(c.order??Number.POSITIVE_INFINITY)-(d.order??Number.POSITIVE_INFINITY)||c.id.localeCompare(d.id)),u=await Promise.all(l.map(async c=>{if(c.type==="iframe")return{...Sp(c),component:()=>g.createElement(tL,{moduleId:c.id,url:c.url,title:c.name}),contributionType:"iframe"};const d=await cL(c,o,{timeoutMs:r,importEntry:s,loadStyle:i});return MS(d)?lL(c,d):d}));return{modules:[...t,...u],hostDiagnostics:[]}}const pL=[];function et(){return et=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},et.apply(null,arguments)}const Ui=(function(e){if(e==null)return gL;if(typeof e=="function")return Ql(e);if(typeof e=="object")return Array.isArray(e)?fL(e):mL(e);if(typeof e=="string")return hL(e);throw new Error("Expected function, string, or object as test")});function fL(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Ui(e[n]);return Ql(r);function r(...s){let i=-1;for(;++i<t.length;)if(t[i].apply(this,s))return!0;return!1}}function mL(e){const t=e;return Ql(n);function n(r){const s=r;let i;for(i in e)if(s[i]!==t[i])return!1;return!0}}function hL(e){return Ql(t);function t(n){return n&&n.type===e}}function Ql(e){return t;function t(n,r,s){return!!(bL(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function gL(){return!0}function bL(e){return e!==null&&typeof e=="object"&&"type"in e}const FS=[],xL=!0,hl=!1,Ja="skip";function Tp(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const i=Ui(s),o=r?-1:1;l(e,void 0,[])();function l(u,c,d){const p=u&&typeof u=="object"?u:{};if(typeof p.type=="string"){const m=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(f,"name",{value:"node ("+(u.type+(m?"<"+m+">":""))+")"})}return f;function f(){let m=FS,b,x,y;if((!t||i(u,c,d[d.length-1]||void 0))&&(m=yL(n(u,d)),m[0]===hl))return m;if("children"in u&&u.children){const E=u;if(E.children&&m[0]!==Ja)for(x=(r?E.children.length:-1)+o,y=d.concat(E);x>-1&&x<E.children.length;){const v=E.children[x];if(b=l(v,x,y)(),b[0]===hl)return b;x=typeof b[1]=="number"?b[1]:x+o}}return m}}}function yL(e){return Array.isArray(e)?e:typeof e=="number"?[xL,e]:e==null?FS:[e]}function vn(e,t,n,r){let s,i,o;typeof t=="function"&&typeof n!="function"?(i=void 0,o=t,s=n):(i=t,o=n,s=r),Tp(e,i,l,s);function l(u,c){const d=c[c.length-1],p=d?d.children.indexOf(u):void 0;return o(u,p,d)}}function Ps(e){return"children"in e?PS(e):"value"in e?e.value:""}function EL(e){return e.type==="text"?e.value:"children"in e?PS(e):""}function PS(e){let t=-1;const n=[];for(;++t<e.children.length;)n[t]=EL(e.children[t]);return n.join("")}const SL={}.hasOwnProperty;function TL(e,t,n){const r=Ui(t),s=t&&typeof t=="object"&&"cascade"in t?t.cascade:void 0,i=s??!0;return o(e);function o(l,u,c){const d=[];if(!r(l,u,c))return;if(NL(l)){let m=-1;for(;++m<l.children.length;){const b=o(l.children[m],m,l);b&&d.push(b)}if(i&&l.children.length>0&&d.length===0)return}const p={};let f;for(f in l)SL.call(l,f)&&(p[f]=f==="children"?d:l[f]);return p}}function NL(e){return"children"in e&&e.children!==void 0}var To={exports:{}},h0;function wL(){return h0||(h0=1,(function(e,t){function n(r){let s=[],i;for(let o of r.split(",").map(l=>l.trim()))if(/^-?\d+$/.test(o))s.push(parseInt(o,10));else if(i=o.match(/^(-?\d+)(-|\.\.\.?|\u2025|\u2026|\u22EF)(-?\d+)$/)){let[l,u,c,d]=i;if(u&&d){u=parseInt(u),d=parseInt(d);const p=u<d?1:-1;(c==="-"||c===".."||c==="‥")&&(d+=p);for(let f=u;f!==d;f+=p)s.push(f)}}return s}t.default=n,e.exports=n})(To,To.exports)),To.exports}var vL=wL();const AL=zl(vL);rt.displayName="clike";rt.aliases=[];function rt(e){e.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}}Yn.displayName="c";Yn.aliases=[];function Yn(e){e.register(rt),e.languages.c=e.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),e.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),e.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},e.languages.c.string],char:e.languages.c.char,comment:e.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:e.languages.c}}}}),e.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete e.languages.c.boolean}ps.displayName="cpp";ps.aliases=[];function ps(e){e.register(Yn),(function(t){var n=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,r=/\b(?!<keyword>)\w+(?:\s*\.\s*\w+)*\b/.source.replace(/<keyword>/g,function(){return n.source});t.languages.cpp=t.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!<keyword>)\w+/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:n,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),t.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/<mod-name>(?:\s*:\s*<mod-name>)?|:\s*<mod-name>/.source.replace(/<mod-name>/g,function(){return r})+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),t.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t.languages.cpp}}}}),t.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),t.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:t.languages.extend("cpp",{})}}),t.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},t.languages.cpp["base-clause"])})(e)}Jl.displayName="arduino";Jl.aliases=["ino"];function Jl(e){e.register(ps),e.languages.arduino=e.languages.extend("cpp",{keyword:/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,constant:/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,builtin:/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/}),e.languages.ino=e.languages.arduino}$i.displayName="bash";$i.aliases=["sh","shell"];function $i(e){(function(t){var n="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",r={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},s={bash:r,environment:{pattern:RegExp("\\$"+n),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+n),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};t.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+n),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},parameter:{pattern:/(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:s},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:r}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:s},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:s.entity}}],environment:{pattern:RegExp("\\$?"+n),alias:"constant"},variable:s.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},r.inside=t.languages.bash;for(var i=["comment","function-name","for-or-select","assign-left","parameter","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],o=s.variable[1].inside,l=0;l<i.length;l++)o[i[l]]=t.languages.bash[i[l]];t.languages.sh=t.languages.bash,t.languages.shell=t.languages.bash})(e)}fs.displayName="csharp";fs.aliases=["cs","dotnet"];function fs(e){e.register(rt),(function(t){function n(I,Z){return I.replace(/<<(\d+)>>/g,function(ie,L){return"(?:"+Z[+L]+")"})}function r(I,Z,ie){return RegExp(n(I,Z),"")}function s(I,Z){for(var ie=0;ie<Z;ie++)I=I.replace(/<<self>>/g,function(){return"(?:"+I+")"});return I.replace(/<<self>>/g,"[^\\s\\S]")}var i={type:"bool byte char decimal double dynamic float int long object sbyte short string uint ulong ushort var void",typeDeclaration:"class enum interface record struct",contextual:"add alias and ascending async await by descending from(?=\\s*(?:\\w|$)) get global group into init(?=\\s*;) join let nameof not notnull on or orderby partial remove select set unmanaged value when where with(?=\\s*{)",other:"abstract as base break case catch checked const continue default delegate do else event explicit extern finally fixed for foreach goto if implicit in internal is lock namespace new null operator out override params private protected public readonly ref return sealed sizeof stackalloc static switch this throw try typeof unchecked unsafe using virtual volatile while yield"};function o(I){return"\\b(?:"+I.trim().replace(/ /g,"|")+")\\b"}var l=o(i.typeDeclaration),u=RegExp(o(i.type+" "+i.typeDeclaration+" "+i.contextual+" "+i.other)),c=o(i.typeDeclaration+" "+i.contextual+" "+i.other),d=o(i.type+" "+i.typeDeclaration+" "+i.other),p=s(/<(?:[^<>;=+\-*/%&|^]|<<self>>)*>/.source,2),f=s(/\((?:[^()]|<<self>>)*\)/.source,2),m=/@?\b[A-Za-z_]\w*\b/.source,b=n(/<<0>>(?:\s*<<1>>)?/.source,[m,p]),x=n(/(?!<<0>>)<<1>>(?:\s*\.\s*<<1>>)*/.source,[c,b]),y=/\[\s*(?:,\s*)*\]/.source,E=n(/<<0>>(?:\s*(?:\?\s*)?<<1>>)*(?:\s*\?)?/.source,[x,y]),v=n(/[^,()<>[\];=+\-*/%&|^]|<<0>>|<<1>>|<<2>>/.source,[p,f,y]),S=n(/\(<<0>>+(?:,<<0>>+)+\)/.source,[v]),A=n(/(?:<<0>>|<<1>>)(?:\s*(?:\?\s*)?<<2>>)*(?:\s*\?)?/.source,[S,x,y]),N={keyword:u,punctuation:/[<>()?,.:[\]]/},T=/'(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'/.source,w=/"(?:\\.|[^\\"\r\n])*"/.source,k=/@"(?:""|\\[\s\S]|[^\\"])*"(?!")/.source;t.languages.csharp=t.languages.extend("clike",{string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[k]),lookbehind:!0,greedy:!0},{pattern:r(/(^|[^@$\\])<<0>>/.source,[w]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\busing\s+static\s+)<<0>>(?=\s*;)/.source,[x]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+<<0>>\s*=\s*)<<1>>(?=\s*;)/.source,[m,A]),lookbehind:!0,inside:N},{pattern:r(/(\busing\s+)<<0>>(?=\s*=)/.source,[m]),lookbehind:!0},{pattern:r(/(\b<<0>>\s+)<<1>>/.source,[l,b]),lookbehind:!0,inside:N},{pattern:r(/(\bcatch\s*\(\s*)<<0>>/.source,[x]),lookbehind:!0,inside:N},{pattern:r(/(\bwhere\s+)<<0>>/.source,[m]),lookbehind:!0},{pattern:r(/(\b(?:is(?:\s+not)?|as)\s+)<<0>>/.source,[E]),lookbehind:!0,inside:N},{pattern:r(/\b<<0>>(?=\s+(?!<<1>>|with\s*\{)<<2>>(?:\s*[=,;:{)\]]|\s+(?:in|when)\b))/.source,[A,d,m]),inside:N}],keyword:u,number:/(?:\b0(?:x[\da-f_]*[\da-f]|b[01_]*[01])|(?:\B\.\d+(?:_+\d+)*|\b\d+(?:_+\d+)*(?:\.\d+(?:_+\d+)*)?)(?:e[-+]?\d+(?:_+\d+)*)?)(?:[dflmu]|lu|ul)?\b/i,operator:/>>=?|<<=?|[-=]>|([-+&|])\1|~|\?\?=?|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),t.languages.insertBefore("csharp","number",{range:{pattern:/\.\./,alias:"operator"}}),t.languages.insertBefore("csharp","punctuation",{"named-parameter":{pattern:r(/([(,]\s*)<<0>>(?=\s*:)/.source,[m]),lookbehind:!0,alias:"punctuation"}}),t.languages.insertBefore("csharp","class-name",{namespace:{pattern:r(/(\b(?:namespace|using)\s+)<<0>>(?:\s*\.\s*<<0>>)*(?=\s*[;{])/.source,[m]),lookbehind:!0,inside:{punctuation:/\./}},"type-expression":{pattern:r(/(\b(?:default|sizeof|typeof)\s*\(\s*(?!\s))(?:[^()\s]|\s(?!\s)|<<0>>)*(?=\s*\))/.source,[f]),lookbehind:!0,alias:"class-name",inside:N},"return-type":{pattern:r(/<<0>>(?=\s+(?:<<1>>\s*(?:=>|[({]|\.\s*this\s*\[)|this\s*\[))/.source,[A,x]),inside:N,alias:"class-name"},"constructor-invocation":{pattern:r(/(\bnew\s+)<<0>>(?=\s*[[({])/.source,[A]),lookbehind:!0,inside:N,alias:"class-name"},"generic-method":{pattern:r(/<<0>>\s*<<1>>(?=\s*\()/.source,[m,p]),inside:{function:r(/^<<0>>/.source,[m]),generic:{pattern:RegExp(p),alias:"class-name",inside:N}}},"type-list":{pattern:r(/\b((?:<<0>>\s+<<1>>|record\s+<<1>>\s*<<5>>|where\s+<<2>>)\s*:\s*)(?:<<3>>|<<4>>|<<1>>\s*<<5>>|<<6>>)(?:\s*,\s*(?:<<3>>|<<4>>|<<6>>))*(?=\s*(?:where|[{;]|=>|$))/.source,[l,b,m,A,u.source,f,/\bnew\s*\(\s*\)/.source]),lookbehind:!0,inside:{"record-arguments":{pattern:r(/(^(?!new\s*\()<<0>>\s*)<<1>>/.source,[b,f]),lookbehind:!0,greedy:!0,inside:t.languages.csharp},keyword:u,"class-name":{pattern:RegExp(A),greedy:!0,inside:N},punctuation:/[,()]/}},preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(#)\b(?:define|elif|else|endif|endregion|error|if|line|nullable|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}});var F=w+"|"+T,C=n(/\/(?![*/])|\/\/[^\r\n]*[\r\n]|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>/.source,[F]),$=s(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),z=/\b(?:assembly|event|field|method|module|param|property|return|type)\b/.source,M=n(/<<0>>(?:\s*\(<<1>>*\))?/.source,[x,$]);t.languages.insertBefore("csharp","class-name",{attribute:{pattern:r(/((?:^|[^\s\w>)?])\s*\[\s*)(?:<<0>>\s*:\s*)?<<1>>(?:\s*,\s*<<1>>)*(?=\s*\])/.source,[z,M]),lookbehind:!0,greedy:!0,inside:{target:{pattern:r(/^<<0>>(?=\s*:)/.source,[z]),alias:"keyword"},"attribute-arguments":{pattern:r(/\(<<0>>*\)/.source,[$]),inside:t.languages.csharp},"class-name":{pattern:RegExp(x),inside:{punctuation:/\./}},punctuation:/[:,]/}}});var G=/:[^}\r\n]+/.source,H=s(n(/[^"'/()]|<<0>>|\(<<self>>*\)/.source,[C]),2),j=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[H,G]),q=s(n(/[^"'/()]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|<<0>>|\(<<self>>*\)/.source,[F]),2),re=n(/\{(?!\{)(?:(?![}:])<<0>>)*<<1>>?\}/.source,[q,G]);function pe(I,Z){return{interpolation:{pattern:r(/((?:^|[^{])(?:\{\{)*)<<0>>/.source,[I]),lookbehind:!0,inside:{"format-string":{pattern:r(/(^\{(?:(?![}:])<<0>>)*)<<1>>(?=\}$)/.source,[Z,G]),lookbehind:!0,inside:{punctuation:/^:/}},punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-csharp",inside:t.languages.csharp}}},string:/[\s\S]+/}}t.languages.insertBefore("csharp","string",{"interpolation-string":[{pattern:r(/(^|[^\\])(?:\$@|@\$)"(?:""|\\[\s\S]|\{\{|<<0>>|[^\\{"])*"/.source,[j]),lookbehind:!0,greedy:!0,inside:pe(j,H)},{pattern:r(/(^|[^@\\])\$"(?:\\.|\{\{|<<0>>|[^\\"{])*"/.source,[re]),lookbehind:!0,greedy:!0,inside:pe(re,q)}],char:{pattern:RegExp(T),greedy:!0}}),t.languages.dotnet=t.languages.cs=t.languages.csharp})(e)}rn.displayName="markup";rn.aliases=["atom","html","mathml","rss","ssml","svg","xml"];function rn(e){e.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},e.languages.markup.tag.inside["attr-value"].inside.entity=e.languages.markup.entity,e.languages.markup.doctype.inside["internal-subset"].inside=e.languages.markup,e.hooks.add("wrap",function(t){t.type==="entity"&&(t.attributes.title=t.content.value.replace(/&/,"&"))}),Object.defineProperty(e.languages.markup.tag,"addInlined",{value:function(n,r){var s={};s["language-"+r]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:e.languages[r]},s.cdata=/^<!\[CDATA\[|\]\]>$/i;var i={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:s}};i["language-"+r]={pattern:/[\s\S]+/,inside:e.languages[r]};var o={};o[n]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return n}),"i"),lookbehind:!0,greedy:!0,inside:i},e.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(e.languages.markup.tag,"addAttribute",{value:function(t,n){e.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[n,"language-"+n],inside:e.languages[n]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),e.languages.html=e.languages.markup,e.languages.mathml=e.languages.markup,e.languages.svg=e.languages.markup,e.languages.xml=e.languages.extend("markup",{}),e.languages.ssml=e.languages.xml,e.languages.atom=e.languages.xml,e.languages.rss=e.languages.xml}Hr.displayName="css";Hr.aliases=[];function Hr(e){(function(t){var n=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+n.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+n.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+n.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+n.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:n,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var r=t.languages.markup;r&&(r.tag.addInlined("style","css"),r.tag.addAttribute("style","css"))})(e)}eu.displayName="diff";eu.aliases=[];function eu(e){(function(t){t.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var n={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(n).forEach(function(r){var s=n[r],i=[];/^\w+$/.test(r)||i.push(/\w+/.exec(r)[0]),r==="diff"&&i.push("bold"),t.languages.diff[r]={pattern:RegExp("^(?:["+s+`].*(?:\r
|
|
80
80
|
?|
|
|
81
81
|
|(?![\\s\\S])))+`,"m"),alias:i,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(r)[0]}}}}),Object.defineProperty(t.languages.diff,"PREFIXES",{value:n})})(e)}tu.displayName="go";tu.aliases=[];function tu(e){e.register(rt),e.languages.go=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),e.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete e.languages.go["class-name"]}nu.displayName="ini";nu.aliases=[];function nu(e){e.languages.ini={comment:{pattern:/(^[ \f\t\v]*)[#;][^\n\r]*/m,lookbehind:!0},section:{pattern:/(^[ \f\t\v]*)\[[^\n\r\]]*\]?/m,lookbehind:!0,inside:{"section-name":{pattern:/(^\[[ \f\t\v]*)[^ \f\t\v\]]+(?:[ \f\t\v]+[^ \f\t\v\]]+)*/,lookbehind:!0,alias:"selector"},punctuation:/\[|\]/}},key:{pattern:/(^[ \f\t\v]*)[^ \f\n\r\t\v=]+(?:[ \f\t\v]+[^ \f\n\r\t\v=]+)*(?=[ \f\t\v]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/(=[ \f\t\v]*)[^ \f\n\r\t\v]+(?:[ \f\t\v]+[^ \f\n\r\t\v]+)*/,lookbehind:!0,alias:"attr-value",inside:{"inner-value":{pattern:/^("|').+(?=\1$)/,lookbehind:!0}}},punctuation:/=/}}ms.displayName="java";ms.aliases=[];function ms(e){e.register(rt),(function(t){var n=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|non-sealed|null|open|opens|package|permits|private|protected|provides|public|record(?!\s*[(){}[\]<>=%~.:,;?+\-*/&|^])|requires|return|sealed|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,r=/(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}},punctuation:/\./}};t.languages.java=t.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"/,lookbehind:!0,greedy:!0},"class-name":[s,{pattern:RegExp(/(^|[^\w.])/.source+r+/[A-Z]\w*(?=\s+\w+\s*[;,=()]|\s*(?:\[[\s,]*\]\s*)?::\s*new\b)/.source),lookbehind:!0,inside:s.inside},{pattern:RegExp(/(\b(?:class|enum|extends|implements|instanceof|interface|new|record|throws)\s+)/.source+r+/[A-Z]\w*\b/.source),lookbehind:!0,inside:s.inside}],keyword:n,function:[t.languages.clike.function,{pattern:/(::\s*)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x(?:\.[\da-f_p+-]+|[\da-f_]+(?:\.[\da-f_p+-]+)?)\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0},constant:/\b[A-Z][A-Z_\d]+\b/}),t.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"},char:{pattern:/'(?:\\.|[^'\\\r\n]){1,6}'/,greedy:!0}}),t.languages.insertBefore("java","class-name",{annotation:{pattern:/(^|[^.])@\w+(?:\s*\.\s*\w+)*/,lookbehind:!0,alias:"punctuation"},generics:{pattern:/<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&)|<(?:[\w\s,.?]|&(?!&))*>)*>)*>)*>/,inside:{"class-name":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}},import:[{pattern:RegExp(/(\bimport\s+)/.source+r+/(?:[A-Z]\w*|\*)(?=\s*;)/.source),lookbehind:!0,inside:{namespace:s.inside.namespace,punctuation:/\./,operator:/\*/,"class-name":/\w+/}},{pattern:RegExp(/(\bimport\s+static\s+)/.source+r+/(?:\w+|\*)(?=\s*;)/.source),lookbehind:!0,alias:"static",inside:{namespace:s.inside.namespace,static:/\b\w+$/,punctuation:/\./,operator:/\*/,"class-name":/\w+/}}],namespace:{pattern:RegExp(/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)(?!<keyword>)[a-z]\w*(?:\.[a-z]\w*)*\.?/.source.replace(/<keyword>/g,function(){return n.source})),lookbehind:!0,inside:{punctuation:/\./}}})})(e)}ru.displayName="regex";ru.aliases=[];function ru(e){(function(t){var n={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},r=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,s={pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},i={pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},o="(?:[^\\\\-]|"+r.source+")",l=RegExp(o+"-"+o),u={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};t.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:l,inside:{escape:r,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":n,"char-set":i,escape:r}},"special-escape":n,"char-set":s,backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":u}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:r,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":u}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}})(e)}cn.displayName="javascript";cn.aliases=["js"];function cn(e){e.register(rt),e.languages.javascript=e.languages.extend("clike",{"class-name":[e.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),e.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,e.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:e.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:e.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:e.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:e.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),e.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:e.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),e.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),e.languages.markup&&(e.languages.markup.tag.addInlined("script","javascript"),e.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),e.languages.js=e.languages.javascript}pa.displayName="json";pa.aliases=["webmanifest"];function pa(e){e.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},e.languages.webmanifest=e.languages.json}su.displayName="kotlin";su.aliases=["kt","kts"];function su(e){e.register(rt),(function(t){t.languages.kotlin=t.languages.extend("clike",{keyword:{pattern:/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,lookbehind:!0},function:[{pattern:/(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,greedy:!0},{pattern:/(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,lookbehind:!0,greedy:!0}],number:/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,operator:/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/}),delete t.languages.kotlin["class-name"];var n={"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:t.languages.kotlin}};t.languages.insertBefore("kotlin","string",{"string-literal":[{pattern:/"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,alias:"multiline",inside:{interpolation:{pattern:/\$(?:[a-z_]\w*|\{[^{}]*\})/i,inside:n},string:/[\s\S]+/}},{pattern:/"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,alias:"singleline",inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,lookbehind:!0,inside:n},string:/[\s\S]+/}}],char:{pattern:/'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,greedy:!0}}),delete t.languages.kotlin.string,t.languages.insertBefore("kotlin","keyword",{annotation:{pattern:/\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,alias:"builtin"}}),t.languages.insertBefore("kotlin","function",{label:{pattern:/\b\w+@|@\w+\b/,alias:"symbol"}}),t.languages.kt=t.languages.kotlin,t.languages.kts=t.languages.kotlin})(e)}au.displayName="less";au.aliases=[];function au(e){e.register(Hr),e.languages.less=e.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),e.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}})}zi.displayName="lua";zi.aliases=[];function zi(e){e.languages.lua={comment:/^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\z(?:\r\n|\s)|\\(?:\r\n|[^z]))*\1|\[(=*)\[[\s\S]*?\]\2\]/,greedy:!0},number:/\b0x[a-f\d]+(?:\.[a-f\d]*)?(?:p[+-]?\d+)?\b|\b\d+(?:\.\B|(?:\.\d*)?(?:e[+-]?\d+)?\b)|\B\.\d+(?:e[+-]?\d+)?\b/i,keyword:/\b(?:and|break|do|else|elseif|end|false|for|function|goto|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,function:/(?!\d)\w+(?=\s*(?:[({]))/,operator:[/[-+*%^&|#]|\/\/?|<[<=]?|>[>=]?|[=~]=?/,{pattern:/(^|[^.])\.\.(?!\.)/,lookbehind:!0}],punctuation:/[\[\](){},;]|\.+|:+/}}iu.displayName="makefile";iu.aliases=[];function iu(e){e.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/}}Hi.displayName="yaml";Hi.aliases=["yml"];function Hi(e){(function(t){var n=/[*&][^\s[\]{},]+/,r=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+r.source+"(?:[ ]+"+n.source+")?|"+n.source+"(?:[ ]+"+r.source+")?)",i=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),o=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function l(u,c){c=(c||"").replace(/m/g,"")+"m";var d=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return u});return RegExp(d,c)}t.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<key>>/g,function(){return"(?:"+i+"|"+o+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:l(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:l(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:l(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:l(o),lookbehind:!0,greedy:!0},number:{pattern:l(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:r,important:n,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},t.languages.yml=t.languages.yaml})(e)}ou.displayName="markdown";ou.aliases=["md"];function ou(e){e.register(rn),(function(t){var n=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function r(l){return l=l.replace(/<inner>/g,function(){return n}),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+l+")")}var s=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,i=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,function(){return s}),o=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;t.languages.markdown=t.languages.extend("markup",{}),t.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:t.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+i+o+"(?:"+i+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+i+o+")(?:"+i+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(s),inside:t.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+i+")"+o+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+i+"$"),inside:{"table-header":{pattern:RegExp(s),alias:"important",inside:t.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:r(/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:r(/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:r(/(~~?)(?:(?!~)<inner>)+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:r(/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach(function(l){["url","bold","italic","strike","code-snippet"].forEach(function(u){l!==u&&(t.languages.markdown[l].inside.content.inside[u]=t.languages.markdown[u])})}),t.hooks.add("after-tokenize",function(l){if(l.language!=="markdown"&&l.language!=="md")return;function u(c){if(!(!c||typeof c=="string"))for(var d=0,p=c.length;d<p;d++){var f=c[d];if(f.type!=="code"){u(f.content);continue}var m=f.content[1],b=f.content[3];if(m&&b&&m.type==="code-language"&&b.type==="code-block"&&typeof m.content=="string"){var x=m.content.replace(/\b#/g,"sharp").replace(/\b\+\+/g,"pp");x=(/[a-z][\w-]*/i.exec(x)||[""])[0].toLowerCase();var y="language-"+x;b.alias?typeof b.alias=="string"?b.alias=[b.alias,y]:b.alias.push(y):b.alias=[y]}}}u(l.tokens)}),t.hooks.add("wrap",function(l){if(l.type==="code-block"){for(var u="",c=0,d=l.classes.length;c<d;c++){var p=l.classes[c],f=/language-(.+)/.exec(p);if(f){u=f[1];break}}var m=t.languages[u];if(m)l.content=t.highlight(l.content.value,m,u);else if(u&&u!=="none"&&t.plugins.autoloader){var b="md-"+new Date().valueOf()+"-"+Math.floor(Math.random()*1e16);l.attributes.id=b,t.plugins.autoloader.loadLanguages(u,function(){var x=document.getElementById(b);x&&(x.innerHTML=t.highlight(x.textContent,t.languages[u],u))})}}}),RegExp(t.languages.markup.tag.pattern.source,"gi"),t.languages.md=t.languages.markdown})(e)}lu.displayName="objectivec";lu.aliases=["objc"];function lu(e){e.register(Yn),e.languages.objectivec=e.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete e.languages.objectivec["class-name"],e.languages.objc=e.languages.objectivec}uu.displayName="perl";uu.aliases=[];function uu(e){(function(t){var n=/(?:\((?:[^()\\]|\\[\s\S])*\)|\{(?:[^{}\\]|\\[\s\S])*\}|\[(?:[^[\]\\]|\\[\s\S])*\]|<(?:[^<>\\]|\\[\s\S])*>)/.source;t.languages.perl={comment:[{pattern:/(^\s*)=\w[\s\S]*?=cut.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],string:[{pattern:RegExp(/\b(?:q|qq|qw|qx)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"),greedy:!0},{pattern:/("|`)(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0},{pattern:/'(?:[^'\\\r\n]|\\.)*'/,greedy:!0}],regex:[{pattern:RegExp(/\b(?:m|qr)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,n].join("|")+")"+/[msixpodualngc]*/.source),greedy:!0},{pattern:RegExp(/(^|[^-])\b(?:s|tr|y)(?![a-zA-Z0-9])\s*/.source+"(?:"+[/([^a-zA-Z0-9\s{(\[<])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2/.source,/([a-zA-Z0-9])(?:(?!\3)[^\\]|\\[\s\S])*\3(?:(?!\3)[^\\]|\\[\s\S])*\3/.source,n+/\s*/.source+n].join("|")+")"+/[msixpodualngcer]*/.source),lookbehind:!0,greedy:!0},{pattern:/\/(?:[^\/\\\r\n]|\\.)*\/[msixpodualngc]*(?=\s*(?:$|[\r\n,.;})&|\-+*~<>!?^]|(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|x|xor)\b))/,greedy:!0}],variable:[/[&*$@%]\{\^[A-Z]+\}/,/[&*$@%]\^[A-Z_]/,/[&*$@%]#?(?=\{)/,/[&*$@%]#?(?:(?:::)*'?(?!\d)[\w$]+(?![\w$]))+(?:::)*/,/[&*$@%]\d+/,/(?!%=)[$@%][!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~]/],filehandle:{pattern:/<(?![<=])\S*?>|\b_\b/,alias:"symbol"},"v-string":{pattern:/v\d+(?:\.\d+)*|\d+(?:\.\d+){2,}/,alias:"string"},function:{pattern:/(\bsub[ \t]+)\w+/,lookbehind:!0},keyword:/\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|return|say|state|sub|switch|undef|unless|until|use|when|while)\b/,number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/,operator:/-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:and|cmp|eq|ge|gt|le|lt|ne|not|or|xor)\b/,punctuation:/[{}[\];(),:]/}})(e)}dn.displayName="markup-templating";dn.aliases=[];function dn(e){e.register(rn),(function(t){function n(r,s){return"___"+r.toUpperCase()+s+"___"}Object.defineProperties(t.languages["markup-templating"]={},{buildPlaceholders:{value:function(r,s,i,o){if(r.language===s){var l=r.tokenStack=[];r.code=r.code.replace(i,function(u){if(typeof o=="function"&&!o(u))return u;for(var c=l.length,d;r.code.indexOf(d=n(s,c))!==-1;)++c;return l[c]=u,d}),r.grammar=t.languages.markup}}},tokenizePlaceholders:{value:function(r,s){if(r.language!==s||!r.tokenStack)return;r.grammar=t.languages[s];var i=0,o=Object.keys(r.tokenStack);function l(u){for(var c=0;c<u.length&&!(i>=o.length);c++){var d=u[c];if(typeof d=="string"||d.content&&typeof d.content=="string"){var p=o[i],f=r.tokenStack[p],m=typeof d=="string"?d:d.content,b=n(s,p),x=m.indexOf(b);if(x>-1){++i;var y=m.substring(0,x),E=new t.Token(s,t.tokenize(f,r.grammar),"language-"+s,f),v=m.substring(x+b.length),S=[];y&&S.push.apply(S,l([y])),S.push(E),v&&S.push.apply(S,l([v])),typeof d=="string"?u.splice.apply(u,[c,1].concat(S)):d.content=S}}else d.content&&l(d.content)}return u}l(r.tokens)}}})})(e)}hs.displayName="php";hs.aliases=[];function hs(e){e.register(dn),(function(t){var n=/\/\*[\s\S]*?\*\/|\/\/.*|#(?!\[).*/,r=[{pattern:/\b(?:false|true)\b/i,alias:"boolean"},{pattern:/(::\s*)\b[a-z_]\w*\b(?!\s*\()/i,greedy:!0,lookbehind:!0},{pattern:/(\b(?:case|const)\s+)\b[a-z_]\w*(?=\s*[;=])/i,greedy:!0,lookbehind:!0},/\b(?:null)\b/i,/\b[A-Z_][A-Z0-9_]*\b(?!\s*\()/],s=/\b0b[01]+(?:_[01]+)*\b|\b0o[0-7]+(?:_[0-7]+)*\b|\b0x[\da-f]+(?:_[\da-f]+)*\b|(?:\b\d+(?:_\d+)*\.?(?:\d+(?:_\d+)*)?|\B\.\d+)(?:e[+-]?\d+)?/i,i=/<?=>|\?\?=?|\.{3}|\??->|[!=]=?=?|::|\*\*=?|--|\+\+|&&|\|\||<<|>>|[?~]|[/^|%*&<>.+-]=?/,o=/[{}\[\](),:;]/;t.languages.php={delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"},comment:n,variable:/\$+(?:\w+\b|(?=\{))/,package:{pattern:/(namespace\s+|use\s+(?:function\s+)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,lookbehind:!0,inside:{punctuation:/\\/}},"class-name-definition":{pattern:/(\b(?:class|enum|interface|trait)\s+)\b[a-z_]\w*(?!\\)\b/i,lookbehind:!0,alias:"class-name"},"function-definition":{pattern:/(\bfunction\s+)[a-z_]\w*(?=\s*\()/i,lookbehind:!0,alias:"function"},keyword:[{pattern:/(\(\s*)\b(?:array|bool|boolean|float|int|integer|object|string)\b(?=\s*\))/i,alias:"type-casting",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|object|self|static|string)\b(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b(?:array(?!\s*\()|bool|callable|(?:false|null)(?=\s*\|)|float|int|iterable|mixed|never|object|self|static|string|void)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/\b(?:array(?!\s*\()|bool|float|int|iterable|mixed|object|string|void)\b/i,alias:"type-declaration",greedy:!0},{pattern:/(\|\s*)(?:false|null)\b|\b(?:false|null)(?=\s*\|)/i,alias:"type-declaration",greedy:!0,lookbehind:!0},{pattern:/\b(?:parent|self|static)(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(\byield\s+)from\b/i,lookbehind:!0},/\bclass\b/i,{pattern:/((?:^|[^\s>:]|(?:^|[^-])>|(?:^|[^:]):)\s*)\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|enum|eval|exit|extends|final|finally|fn|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|never|new|or|parent|print|private|protected|public|readonly|require|require_once|return|self|static|switch|throw|trait|try|unset|use|var|while|xor|yield|__halt_compiler)\b/i,lookbehind:!0}],"argument-name":{pattern:/([(,]\s*)\b[a-z_]\w*(?=\s*:(?!:))/i,lookbehind:!0},"class-name":[{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self|\s+static))\s+|\bcatch\s*\()\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/(\|\s*)\b[a-z_]\w*(?!\\)\b/i,greedy:!0,lookbehind:!0},{pattern:/\b[a-z_]\w*(?!\\)\b(?=\s*\|)/i,greedy:!0},{pattern:/(\|\s*)(?:\\?\b[a-z_]\w*)+\b/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(?:\\?\b[a-z_]\w*)+\b(?=\s*\|)/i,alias:"class-name-fully-qualified",greedy:!0,inside:{punctuation:/\\/}},{pattern:/(\b(?:extends|implements|instanceof|new(?!\s+self\b|\s+static\b))\s+|\bcatch\s*\()(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:"class-name-fully-qualified",greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*\$)/i,alias:"type-declaration",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-declaration"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/\b[a-z_]\w*(?=\s*::)/i,alias:"static-context",greedy:!0},{pattern:/(?:\\?\b[a-z_]\w*)+(?=\s*::)/i,alias:["class-name-fully-qualified","static-context"],greedy:!0,inside:{punctuation:/\\/}},{pattern:/([(,?]\s*)[a-z_]\w*(?=\s*\$)/i,alias:"type-hint",greedy:!0,lookbehind:!0},{pattern:/([(,?]\s*)(?:\\?\b[a-z_]\w*)+(?=\s*\$)/i,alias:["class-name-fully-qualified","type-hint"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}},{pattern:/(\)\s*:\s*(?:\?\s*)?)\b[a-z_]\w*(?!\\)\b/i,alias:"return-type",greedy:!0,lookbehind:!0},{pattern:/(\)\s*:\s*(?:\?\s*)?)(?:\\?\b[a-z_]\w*)+\b(?!\\)/i,alias:["class-name-fully-qualified","return-type"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,function:{pattern:/(^|[^\\\w])\\?[a-z_](?:[\w\\]*\w)?(?=\s*\()/i,lookbehind:!0,inside:{punctuation:/\\/}},property:{pattern:/(->\s*)\w+/,lookbehind:!0},number:s,operator:i,punctuation:o};var l={pattern:/\{\$(?:\{(?:\{[^{}]+\}|[^{}]+)\}|[^{}])+\}|(^|[^\\{])\$+(?:\w+(?:\[[^\r\n\[\]]+\]|->\w+)?)/,lookbehind:!0,inside:t.languages.php},u=[{pattern:/<<<'([^']+)'[\r\n](?:.*[\r\n])*?\1;/,alias:"nowdoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},{pattern:/<<<(?:"([^"]+)"[\r\n](?:.*[\r\n])*?\1;|([a-z_]\w*)[\r\n](?:.*[\r\n])*?\2;)/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:l}},{pattern:/`(?:\\[\s\S]|[^\\`])*`/,alias:"backtick-quoted-string",greedy:!0},{pattern:/'(?:\\[\s\S]|[^\\'])*'/,alias:"single-quoted-string",greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,alias:"double-quoted-string",greedy:!0,inside:{interpolation:l}}];t.languages.insertBefore("php","variable",{string:u,attribute:{pattern:/#\[(?:[^"'\/#]|\/(?![*/])|\/\/.*$|#(?!\[).*$|\/\*(?:[^*]|\*(?!\/))*\*\/|"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*')+\](?=\s*[a-z$#])/im,greedy:!0,inside:{"attribute-content":{pattern:/^(#\[)[\s\S]+(?=\]$)/,lookbehind:!0,inside:{comment:n,string:u,"attribute-class-name":[{pattern:/([^:]|^)\b[a-z_]\w*(?!\\)\b/i,alias:"class-name",greedy:!0,lookbehind:!0},{pattern:/([^:]|^)(?:\\?\b[a-z_]\w*)+/i,alias:["class-name","class-name-fully-qualified"],greedy:!0,lookbehind:!0,inside:{punctuation:/\\/}}],constant:r,number:s,operator:i,punctuation:o}},delimiter:{pattern:/^#\[|\]$/,alias:"punctuation"}}}}),t.hooks.add("before-tokenize",function(c){if(/<\?/.test(c.code)){var d=/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#(?!\[))(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|#\[|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$))*?(?:\?>|$)/g;t.languages["markup-templating"].buildPlaceholders(c,"php",d)}}),t.hooks.add("after-tokenize",function(c){t.languages["markup-templating"].tokenizePlaceholders(c,"php")})})(e)}Gi.displayName="python";Gi.aliases=["py"];function Gi(e){e.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.python["string-interpolation"].inside.interpolation.inside.rest=e.languages.python,e.languages.py=e.languages.python}cu.displayName="r";cu.aliases=[];function cu(e){e.languages.r={comment:/#.*/,string:{pattern:/(['"])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"percent-operator":{pattern:/%[^%\s]*%/,alias:"operator"},boolean:/\b(?:FALSE|TRUE)\b/,ellipsis:/\.\.(?:\.|\d+)/,number:[/\b(?:Inf|NaN)\b/,/(?:\b0x[\dA-Fa-f]+(?:\.\d*)?|\b\d+(?:\.\d*)?|\B\.\d+)(?:[EePp][+-]?\d+)?[iL]?/],keyword:/\b(?:NA|NA_character_|NA_complex_|NA_integer_|NA_real_|NULL|break|else|for|function|if|in|next|repeat|while)\b/,operator:/->?>?|<(?:=|<?-)?|[>=!]=?|::?|&&?|\|\|?|[+*\/^$@~]/,punctuation:/[(){}\[\],;]/}}gs.displayName="ruby";gs.aliases=["rb"];function gs(e){e.register(rt),(function(t){t.languages.ruby=t.languages.extend("clike",{comment:{pattern:/#.*|^=begin\s[\s\S]*?^=end/m,greedy:!0},"class-name":{pattern:/(\b(?:class|module)\s+|\bcatch\s+\()[\w.\\]+|\b[A-Z_]\w*(?=\s*\.\s*new\b)/,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:BEGIN|END|alias|and|begin|break|case|class|def|define_method|defined|do|each|else|elsif|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|private|protected|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/,operator:/\.{2,3}|&\.|===|<?=>|[!=]?~|(?:&&|\|\||<<|>>|\*\*|[+\-*/%<>!^&|=])=?|[?:]/,punctuation:/[(){}[\].,;]/}),t.languages.insertBefore("ruby","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}});var n={pattern:/((?:^|[^\\])(?:\\{2})*)#\{(?:[^{}]|\{[^{}]*\})*\}/,lookbehind:!0,inside:{content:{pattern:/^(#\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:t.languages.ruby},delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"}}};delete t.languages.ruby.function;var r="(?:"+[/([^a-zA-Z0-9\s{(\[<=])(?:(?!\1)[^\\]|\\[\s\S])*\1/.source,/\((?:[^()\\]|\\[\s\S]|\((?:[^()\\]|\\[\s\S])*\))*\)/.source,/\{(?:[^{}\\]|\\[\s\S]|\{(?:[^{}\\]|\\[\s\S])*\})*\}/.source,/\[(?:[^\[\]\\]|\\[\s\S]|\[(?:[^\[\]\\]|\\[\s\S])*\])*\]/.source,/<(?:[^<>\\]|\\[\s\S]|<(?:[^<>\\]|\\[\s\S])*>)*>/.source].join("|")+")",s=/(?:"(?:\\.|[^"\\\r\n])*"|(?:\b[a-zA-Z_]\w*|[^\s\0-\x7F]+)[?!]?|\$.)/.source;t.languages.insertBefore("ruby","keyword",{"regex-literal":[{pattern:RegExp(/%r/.source+r+/[egimnosux]{0,6}/.source),greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}},{pattern:/(^|[^/])\/(?!\/)(?:\[[^\r\n\]]+\]|\\.|[^[/\\\r\n])+\/[egimnosux]{0,6}(?=\s*(?:$|[\r\n,.;})#]))/,lookbehind:!0,greedy:!0,inside:{interpolation:n,regex:/[\s\S]+/}}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:[{pattern:RegExp(/(^|[^:]):/.source+s),lookbehind:!0,greedy:!0},{pattern:RegExp(/([\r\n{(,][ \t]*)/.source+s+/(?=:(?!:))/.source),lookbehind:!0,greedy:!0}],"method-definition":{pattern:/(\bdef\s+)\w+(?:\s*\.\s*\w+)?/,lookbehind:!0,inside:{function:/\b\w+$/,keyword:/^self\b/,"class-name":/^\w+/,punctuation:/\./}}}),t.languages.insertBefore("ruby","string",{"string-literal":[{pattern:RegExp(/%[qQiIwWs]?/.source+r),greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/("|')(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|(?!\1)[^\\#\r\n])*\1/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?([a-z_]\w*)[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?[a-z_]\w*|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?/}},interpolation:n,string:/[\s\S]+/}},{pattern:/<<[-~]?'([a-z_]\w*)'[\r\n](?:.*[\r\n])*?[\t ]*\1/i,alias:"heredoc-string",greedy:!0,inside:{delimiter:{pattern:/^<<[-~]?'[a-z_]\w*'|\b[a-z_]\w*$/i,inside:{symbol:/\b\w+/,punctuation:/^<<[-~]?'|'$/}},string:/[\s\S]+/}}],"command-literal":[{pattern:RegExp(/%x/.source+r),greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}},{pattern:/`(?:#\{[^}]+\}|#(?!\{)|\\(?:\r\n|[\s\S])|[^\\`#\r\n])*`/,greedy:!0,inside:{interpolation:n,command:{pattern:/[\s\S]+/,alias:"string"}}}]}),delete t.languages.ruby.string,t.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Fixnum|Float|Hash|IO|Integer|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|Stat|String|Struct|Symbol|TMS|Thread|ThreadGroup|Time|TrueClass)\b/,constant:/\b[A-Z][A-Z0-9_]*(?:[?!]|\b)/}),t.languages.rb=t.languages.ruby})(e)}du.displayName="rust";du.aliases=[];function du(e){(function(t){for(var n=/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|<self>)*\*\//.source,r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,function(){return/[^\s\S]/.source}),t.languages.rust={comment:[{pattern:RegExp(/(^|[^\\])/.source+n),lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/b?"(?:\\[\s\S]|[^\\"])*"|b?r(#*)"(?:[^"]|"(?!\1))*"\1/,greedy:!0},char:{pattern:/b?'(?:\\(?:x[0-7][\da-fA-F]|u\{(?:[\da-fA-F]_*){1,6}\}|.)|[^\\\r\n\t'])'/,greedy:!0},attribute:{pattern:/#!?\[(?:[^\[\]"]|"(?:\\[\s\S]|[^\\"])*")*\]/,greedy:!0,alias:"attr-name",inside:{string:null}},"closure-params":{pattern:/([=(,:]\s*|\bmove\s*)\|[^|]*\||\|[^|]*\|(?=\s*(?:\{|->))/,lookbehind:!0,greedy:!0,inside:{"closure-punctuation":{pattern:/^\||\|$/,alias:"punctuation"},rest:null}},"lifetime-annotation":{pattern:/'\w+/,alias:"symbol"},"fragment-specifier":{pattern:/(\$\w+:)[a-z]+/,lookbehind:!0,alias:"punctuation"},variable:/\$\w+/,"function-definition":{pattern:/(\bfn\s+)\w+/,lookbehind:!0,alias:"function"},"type-definition":{pattern:/(\b(?:enum|struct|trait|type|union)\s+)\w+/,lookbehind:!0,alias:"class-name"},"module-declaration":[{pattern:/(\b(?:crate|mod)\s+)[a-z][a-z_\d]*/,lookbehind:!0,alias:"namespace"},{pattern:/(\b(?:crate|self|super)\s*)::\s*[a-z][a-z_\d]*\b(?:\s*::(?:\s*[a-z][a-z_\d]*\s*::)*)?/,lookbehind:!0,alias:"namespace",inside:{punctuation:/::/}}],keyword:[/\b(?:Self|abstract|as|async|await|become|box|break|const|continue|crate|do|dyn|else|enum|extern|final|fn|for|if|impl|in|let|loop|macro|match|mod|move|mut|override|priv|pub|ref|return|self|static|struct|super|trait|try|type|typeof|union|unsafe|unsized|use|virtual|where|while|yield)\b/,/\b(?:bool|char|f(?:32|64)|[ui](?:8|16|32|64|128|size)|str)\b/],function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())/,macro:{pattern:/\b\w+!/,alias:"property"},constant:/\b[A-Z_][A-Z_\d]+\b/,"class-name":/\b[A-Z]\w*\b/,namespace:{pattern:/(?:\b[a-z][a-z_\d]*\s*::\s*)*\b[a-z][a-z_\d]*\s*::(?!\s*<)/,inside:{punctuation:/::/}},number:/\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(?:(?:\d(?:_?\d)*)?\.)?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:f32|f64|[iu](?:8|16|32|64|size)?))?\b/,boolean:/\b(?:false|true)\b/,punctuation:/->|\.\.=|\.{1,3}|::|[{}[\];(),:]/,operator:/[-+*\/%!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?=?|[@?]/},t.languages.rust["closure-params"].inside.rest=t.languages.rust,t.languages.rust.attribute.inside.string=t.languages.rust.string})(e)}pu.displayName="sass";pu.aliases=[];function pu(e){e.register(Hr),(function(t){t.languages.sass=t.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),t.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete t.languages.sass.atrule;var n=/\$[-\w]+|#\{\$[-\w]+\}/,r=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];t.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:n,operator:r}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:n,operator:r,important:t.languages.sass.important}}}),delete t.languages.sass.property,delete t.languages.sass.important,t.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})})(e)}fu.displayName="scss";fu.aliases=[];function fu(e){e.register(Hr),e.languages.scss=e.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),e.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),e.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),e.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),e.languages.scss.atrule.inside.rest=e.languages.scss}fa.displayName="sql";fa.aliases=[];function fa(e){e.languages.sql={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},variable:[{pattern:/@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/,greedy:!0},/@[\w.$]+/],string:{pattern:/(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,greedy:!0,lookbehind:!0},identifier:{pattern:/(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/,greedy:!0,lookbehind:!0,inside:{punctuation:/^`|`$/}},function:/\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i,keyword:/\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/i,number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/}}mu.displayName="swift";mu.aliases=[];function mu(e){e.languages.swift={comment:{pattern:/(^|[^\\:])(?:\/\/.*|\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\/)/,lookbehind:!0,greedy:!0},"string-literal":[{pattern:RegExp(/(^|[^"#])/.source+"(?:"+/"(?:\\(?:\((?:[^()]|\([^()]*\))*\)|\r\n|[^(])|[^\\\r\n"])*"/.source+"|"+/"""(?:\\(?:\((?:[^()]|\([^()]*\))*\)|[^(])|[^\\"]|"(?!""))*"""/.source+")"+/(?!["#])/.source),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\\($/,alias:"punctuation"},punctuation:/\\(?=[\r\n])/,string:/[\s\S]+/}},{pattern:RegExp(/(^|[^"#])(#+)/.source+"(?:"+/"(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|\r\n|[^#])|[^\\\r\n])*?"/.source+"|"+/"""(?:\\(?:#+\((?:[^()]|\([^()]*\))*\)|[^#])|[^\\])*?"""/.source+")\\2"),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/(\\#+\()(?:[^()]|\([^()]*\))*(?=\))/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/^\)|\\#+\($/,alias:"punctuation"},string:/[\s\S]+/}}],directive:{pattern:RegExp(/#/.source+"(?:"+(/(?:elseif|if)\b/.source+"(?:[ ]*"+/(?:![ \t]*)?(?:\b\w+\b(?:[ \t]*\((?:[^()]|\([^()]*\))*\))?|\((?:[^()]|\([^()]*\))*\))(?:[ \t]*(?:&&|\|\|))?/.source+")+")+"|"+/(?:else|endif)\b/.source+")"),alias:"property",inside:{"directive-name":/^#\w+/,boolean:/\b(?:false|true)\b/,number:/\b\d+(?:\.\d+)*\b/,operator:/!|&&|\|\||[<>]=?/,punctuation:/[(),]/}},literal:{pattern:/#(?:colorLiteral|column|dsohandle|file(?:ID|Literal|Path)?|function|imageLiteral|line)\b/,alias:"constant"},"other-directive":{pattern:/#\w+\b/,alias:"property"},attribute:{pattern:/@\w+/,alias:"atrule"},"function-definition":{pattern:/(\bfunc\s+)\w+/,lookbehind:!0,alias:"function"},label:{pattern:/\b(break|continue)\s+\w+|\b[a-zA-Z_]\w*(?=\s*:\s*(?:for|repeat|while)\b)/,lookbehind:!0,alias:"important"},keyword:/\b(?:Any|Protocol|Self|Type|actor|as|assignment|associatedtype|associativity|async|await|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|else|enum|extension|fallthrough|fileprivate|final|for|func|get|guard|higherThan|if|import|in|indirect|infix|init|inout|internal|is|isolated|lazy|left|let|lowerThan|mutating|none|nonisolated|nonmutating|open|operator|optional|override|postfix|precedencegroup|prefix|private|protocol|public|repeat|required|rethrows|return|right|safe|self|set|some|static|struct|subscript|super|switch|throw|throws|try|typealias|unowned|unsafe|var|weak|where|while|willSet)\b/,boolean:/\b(?:false|true)\b/,nil:{pattern:/\bnil\b/,alias:"constant"},"short-argument":/\$\d+\b/,omit:{pattern:/\b_\b/,alias:"keyword"},number:/\b(?:[\d_]+(?:\.[\de_]+)?|0x[a-f0-9_]+(?:\.[a-f0-9p_]+)?|0b[01_]+|0o[0-7_]+)\b/i,"class-name":/\b[A-Z](?:[A-Z_\d]*[a-z]\w*)?\b/,function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:[A-Z_]{2,}|k[A-Z][A-Za-z_]+)\b/,operator:/[-+*/%=!<>&|^~?]+|\.[.\-+*/%=!<>&|^~?]+/,punctuation:/[{}[\]();,.:\\]/},e.languages.swift["string-literal"].forEach(function(t){t.inside.interpolation.inside=e.languages.swift})}ma.displayName="typescript";ma.aliases=["ts"];function ma(e){e.register(cn),(function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var n=t.languages.extend("typescript",{});delete n["class-name"],t.languages.typescript["class-name"].inside=n,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:n}}}}),t.languages.ts=t.languages.typescript})(e)}Wi.displayName="basic";Wi.aliases=[];function Wi(e){e.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}}qi.displayName="vbnet";qi.aliases=[];function qi(e){e.register(Wi),e.languages.vbnet=e.languages.extend("basic",{comment:[{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},{pattern:/(^|[^\\:])'.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^"])"(?:""|[^"])*"(?!")/,lookbehind:!0,greedy:!0},keyword:/(?:\b(?:ADDHANDLER|ADDRESSOF|ALIAS|AND|ANDALSO|AS|BEEP|BLOAD|BOOLEAN|BSAVE|BYREF|BYTE|BYVAL|CALL(?: ABSOLUTE)?|CASE|CATCH|CBOOL|CBYTE|CCHAR|CDATE|CDBL|CDEC|CHAIN|CHAR|CHDIR|CINT|CLASS|CLEAR|CLNG|CLOSE|CLS|COBJ|COM|COMMON|CONST|CONTINUE|CSBYTE|CSHORT|CSNG|CSTR|CTYPE|CUINT|CULNG|CUSHORT|DATA|DATE|DECIMAL|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DEFAULT|DELEGATE|DIM|DIRECTCAST|DO|DOUBLE|ELSE|ELSEIF|END|ENUM|ENVIRON|ERASE|ERROR|EVENT|EXIT|FALSE|FIELD|FILES|FINALLY|FOR(?: EACH)?|FRIEND|FUNCTION|GET|GETTYPE|GETXMLNAMESPACE|GLOBAL|GOSUB|GOTO|HANDLES|IF|IMPLEMENTS|IMPORTS|IN|INHERITS|INPUT|INTEGER|INTERFACE|IOCTL|IS|ISNOT|KEY|KILL|LET|LIB|LIKE|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|ME|MKDIR|MOD|MODULE|MUSTINHERIT|MUSTOVERRIDE|MYBASE|MYCLASS|NAME|NAMESPACE|NARROWING|NEW|NEXT|NOT|NOTHING|NOTINHERITABLE|NOTOVERRIDABLE|OBJECT|OF|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPERATOR|OPTION(?: BASE)?|OPTIONAL|OR|ORELSE|OUT|OVERLOADS|OVERRIDABLE|OVERRIDES|PARAMARRAY|PARTIAL|POKE|PRIVATE|PROPERTY|PROTECTED|PUBLIC|PUT|RAISEEVENT|READ|READONLY|REDIM|REM|REMOVEHANDLER|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SBYTE|SELECT(?: CASE)?|SET|SHADOWS|SHARED|SHELL|SHORT|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|STRUCTURE|SUB|SWAP|SYNCLOCK|SYSTEM|THEN|THROW|TIMER|TO|TROFF|TRON|TRUE|TRY|TRYCAST|TYPE|TYPEOF|UINTEGER|ULONG|UNLOCK|UNTIL|USHORT|USING|VIEW PRINT|WAIT|WEND|WHEN|WHILE|WIDENING|WITH|WITHEVENTS|WRITE|WRITEONLY|XOR)|\B(?:#CONST|#ELSE|#ELSEIF|#END|#IF))(?:\$|\b)/i,punctuation:/[,;:(){}]/})}let Vi=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Vi.prototype.normal={};Vi.prototype.property={};Vi.prototype.space=void 0;function BS(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Vi(n,r,t)}function wi(e){return e.toLowerCase()}class kn{constructor(t,n){this.attribute=n,this.property=t}}kn.prototype.attribute="";kn.prototype.booleanish=!1;kn.prototype.boolean=!1;kn.prototype.commaOrSpaceSeparated=!1;kn.prototype.commaSeparated=!1;kn.prototype.defined=!1;kn.prototype.mustUseProperty=!1;kn.prototype.number=!1;kn.prototype.overloadedBoolean=!1;kn.prototype.property="";kn.prototype.spaceSeparated=!1;kn.prototype.space=void 0;let kL=0;const ze=bs(),Wt=bs(),hd=bs(),xe=bs(),Et=bs(),ts=bs(),Cn=bs();function bs(){return 2**++kL}const gd=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Wt,commaOrSpaceSeparated:Cn,commaSeparated:ts,number:xe,overloadedBoolean:hd,spaceSeparated:Et},Symbol.toStringTag,{value:"Module"})),ec=Object.keys(gd);class Np extends kn{constructor(t,n,r,s){let i=-1;if(super(t,n),g0(this,"space",s),typeof r=="number")for(;++i<ec.length;){const o=ec[i];g0(this,ec[i],(r&gd[o])===gd[o])}}}Np.prototype.defined=!0;function g0(e,t,n){n&&(e[t]=n)}function ha(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const i=new Np(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),t[r]=i,n[wi(r)]=r,n[wi(i.attribute)]=r}return new Vi(t,n,e.space)}const US=ha({properties:{ariaActiveDescendant:null,ariaAtomic:Wt,ariaAutoComplete:null,ariaBusy:Wt,ariaChecked:Wt,ariaColCount:xe,ariaColIndex:xe,ariaColSpan:xe,ariaControls:Et,ariaCurrent:null,ariaDescribedBy:Et,ariaDetails:null,ariaDisabled:Wt,ariaDropEffect:Et,ariaErrorMessage:null,ariaExpanded:Wt,ariaFlowTo:Et,ariaGrabbed:Wt,ariaHasPopup:null,ariaHidden:Wt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Et,ariaLevel:xe,ariaLive:null,ariaModal:Wt,ariaMultiLine:Wt,ariaMultiSelectable:Wt,ariaOrientation:null,ariaOwns:Et,ariaPlaceholder:null,ariaPosInSet:xe,ariaPressed:Wt,ariaReadOnly:Wt,ariaRelevant:null,ariaRequired:Wt,ariaRoleDescription:Et,ariaRowCount:xe,ariaRowIndex:xe,ariaRowSpan:xe,ariaSelected:Wt,ariaSetSize:xe,ariaSort:null,ariaValueMax:xe,ariaValueMin:xe,ariaValueNow:xe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function $S(e,t){return t in e?e[t]:t}function zS(e,t){return $S(e,t.toLowerCase())}const _L=ha({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ts,acceptCharset:Et,accessKey:Et,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alpha:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:Et,autoFocus:ze,autoPlay:ze,blocking:Et,capture:null,charSet:null,checked:ze,cite:null,className:Et,closedBy:null,colorSpace:null,cols:xe,colSpan:xe,command:null,commandFor:null,content:null,contentEditable:Wt,controls:ze,controlsList:Et,coords:xe|ts,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:hd,draggable:Wt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:Et,height:xe,hidden:hd,high:xe,href:null,hrefLang:null,htmlFor:Et,httpEquiv:Et,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:Et,itemRef:Et,itemScope:ze,itemType:Et,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:xe,manifest:null,max:null,maxLength:xe,media:null,method:null,min:null,minLength:xe,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ze,optimum:xe,pattern:null,ping:Et,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:Et,required:ze,reversed:ze,rows:xe,rowSpan:xe,sandbox:Et,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootCustomElementRegistry:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shadowRootSerializable:ze,shape:null,size:xe,sizes:null,slot:null,span:xe,spellCheck:Wt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:xe,step:null,style:null,tabIndex:xe,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Wt,width:xe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Et,axis:null,background:null,bgColor:null,border:xe,borderColor:null,bottomMargin:xe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:xe,leftMargin:xe,link:null,longDesc:null,lowSrc:null,marginHeight:xe,marginWidth:xe,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:xe,rules:null,scheme:null,scrolling:Wt,standby:null,summary:null,text:null,topMargin:xe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:xe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:ze,disablePictureInPicture:ze,disableRemotePlayback:ze,exportParts:ts,part:Et,prefix:null,property:null,results:xe,security:null,unselectable:null},space:"html",transform:zS}),CL=ha({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Cn,accentHeight:xe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:xe,amplitude:xe,arabicForm:null,ascent:xe,attributeName:null,attributeType:null,azimuth:xe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:xe,by:null,calcMode:null,capHeight:xe,className:Et,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:xe,diffuseConstant:xe,direction:null,display:null,dur:null,divisor:xe,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:xe,enableBackground:null,end:null,event:null,exponent:xe,externalResourcesRequired:null,fill:null,fillOpacity:xe,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ts,g2:ts,glyphName:ts,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:xe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:xe,horizOriginX:xe,horizOriginY:xe,id:null,ideographic:xe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:xe,k:xe,k1:xe,k2:xe,k3:xe,k4:xe,kernelMatrix:Cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:xe,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:xe,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:xe,overlineThickness:xe,paintOrder:null,panose1:null,path:null,pathLength:xe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Et,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:xe,pointsAtY:xe,pointsAtZ:xe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Cn,rev:Cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Cn,requiredFeatures:Cn,requiredFonts:Cn,requiredFormats:Cn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:xe,specularExponent:xe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:xe,strikethroughThickness:xe,string:null,stroke:null,strokeDashArray:Cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:xe,strokeOpacity:xe,strokeWidth:null,style:null,surfaceScale:xe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Cn,tabIndex:xe,tableValues:null,target:null,targetX:xe,targetY:xe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:xe,underlineThickness:xe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:xe,values:null,vAlphabetic:xe,vMathematical:xe,vectorEffect:null,vHanging:xe,vIdeographic:xe,version:null,vertAdvY:xe,vertOriginX:xe,vertOriginY:xe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:xe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:$S}),HS=ha({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),GS=ha({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zS}),WS=ha({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),IL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},RL=/[A-Z]/g,b0=/-[a-z]/g,DL=/^data[-\w.:]+$/i;function ga(e,t){const n=wi(t);let r=t,s=kn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&DL.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(b0,LL);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!b0.test(i)){let o=i.replace(RL,OL);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}s=Np}return new s(r,t)}function OL(e){return"-"+e.toLowerCase()}function LL(e){return e.charAt(1).toUpperCase()}const xs=BS([US,_L,HS,GS,WS],"html"),Kn=BS([US,CL,HS,GS,WS],"svg");function bd(e){const t=[],n=String(e||"");let r=n.indexOf(","),s=0,i=!1;for(;!i;){r===-1&&(r=n.length,i=!0);const o=n.slice(s,r).trim();(o||!i)&&t.push(o),s=r+1,r=n.indexOf(",",s)}return t}function hu(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const x0=/[#.]/g;function jL(e,t){const n=e||"",r={};let s=0,i,o;for(;s<n.length;){x0.lastIndex=s;const l=x0.exec(n),u=n.slice(s,l?l.index:n.length);u&&(i?i==="#"?r.id=u:Array.isArray(r.className)?r.className.push(u):r.className=[u]:o=u,s+=u.length),l&&(i=l[0],s++)}return{type:"element",tagName:o||t||"div",properties:r,children:[]}}function xd(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function gu(e){return e.join(" ").trim()}function qS(e,t,n){const r=n?BL(n):void 0;function s(i,o,...l){let u;if(i==null){u={type:"root",children:[]};const c=o;l.unshift(c)}else{u=jL(i,t);const c=u.tagName.toLowerCase(),d=r?r.get(c):void 0;if(u.tagName=d||c,ML(o))l.unshift(o);else for(const[p,f]of Object.entries(o))FL(e,u.properties,p,f)}for(const c of l)yd(u.children,c);return u.type==="element"&&u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}return s}function ML(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const r of n){const s=t[r];if(s&&typeof s=="object"){if(!Array.isArray(s))return!0;const i=s;for(const o of i)if(typeof o!="number"&&typeof o!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function FL(e,t,n,r){const s=ga(e,n);let i;if(r!=null){if(typeof r=="number"){if(Number.isNaN(r))return;i=r}else typeof r=="boolean"?i=r:typeof r=="string"?s.spaceSeparated?i=xd(r):s.commaSeparated?i=bd(r):s.commaOrSpaceSeparated?i=xd(bd(r).join(" ")):i=y0(s,s.property,r):Array.isArray(r)?i=[...r]:i=s.property==="style"?PL(r):String(r);if(Array.isArray(i)){const o=[];for(const l of i)o.push(y0(s,s.property,l));i=o}s.property==="className"&&Array.isArray(t.className)&&(i=t.className.concat(i)),t[s.property]=i}}function yd(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)yd(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?yd(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function y0(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||wi(n)===wi(t)))return!0}return n}function PL(e){const t=[];for(const[n,r]of Object.entries(e))t.push([n,r].join(": "));return t.join("; ")}function BL(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const UL=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],VS=qS(xs,"div"),$L=qS(Kn,"g",UL),YS=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],E0={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function KS(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}function zL(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}function HL(e){const t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}function S0(e){return HL(e)||KS(e)}const T0=document.createElement("i");function vi(e){const t="&"+e+";";T0.innerHTML=t;const n=T0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}const GL=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function WL(e,t){const n={},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,s=[];let i=0,o=-1,l="",u,c;n.position&&("start"in n.position||"indent"in n.position?(c=n.position.indent,u=n.position.start):u=n.position);let d=(u?u.line:0)||1,p=(u?u.column:0)||1,f=b(),m;for(i--;++i<=e.length;)if(m===10&&(p=(c?c[o]:0)||1),m=e.charCodeAt(i),m===38){const E=e.charCodeAt(i+1);if(E===9||E===10||E===12||E===32||E===38||E===60||Number.isNaN(E)||r&&E===r){l+=String.fromCharCode(m),p++;continue}const v=i+1;let S=v,A=v,N;if(E===35){A=++S;const M=e.charCodeAt(A);M===88||M===120?(N="hexadecimal",A=++S):N="decimal"}else N="named";let T="",w="",k="";const F=N==="named"?S0:N==="decimal"?KS:zL;for(A--;++A<=e.length;){const M=e.charCodeAt(A);if(!F(M))break;k+=String.fromCharCode(M),N==="named"&&YS.includes(k)&&(T=k,w=vi(k))}let C=e.charCodeAt(A)===59;if(C){A++;const M=N==="named"?vi(k):!1;M&&(T=k,w=M)}let $=1+A-v,z="";if(!(!C&&n.nonTerminated===!1))if(!k)N!=="named"&&x(4,$);else if(N==="named"){if(C&&!w)x(5,1);else if(T!==k&&(A=S+T.length,$=1+A-S,C=!1),!C){const M=T?1:3;if(n.attribute){const G=e.charCodeAt(A);G===61?(x(M,$),w=""):S0(G)?w="":x(M,$)}else x(M,$)}z=w}else{C||x(2,$);let M=Number.parseInt(k,N==="hexadecimal"?16:10);if(qL(M))x(7,$),z="�";else if(M in E0)x(6,$),z=E0[M];else{let G="";VL(M)&&x(6,$),M>65535&&(M-=65536,G+=String.fromCharCode(M>>>10|55296),M=56320|M&1023),z=G+String.fromCharCode(M)}}if(z){y(),f=b(),i=A-1,p+=A-v+1,s.push(z);const M=b();M.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,z,{start:f,end:M},e.slice(v-1,A)),f=M}else k=e.slice(v-1,A),l+=k,p+=k.length,i=A-1}else m===10&&(d++,o++,p=0),Number.isNaN(m)?y():(l+=String.fromCharCode(m),p++);return s.join("");function b(){return{line:d,column:p,offset:i+((u?u.offset:0)||0)}}function x(E,v){let S;n.warning&&(S=b(),S.column+=v,S.offset+=v,n.warning.call(n.warningContext||void 0,GL[E],S,E))}function y(){l&&(s.push(l),n.text&&n.text.call(n.textContext||void 0,l,{start:f,end:b()}),l="")}}function qL(e){return e>=55296&&e<=57343||e>1114111}function VL(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var YL=0,No={},Xt={util:{type:function(e){return Object.prototype.toString.call(e).slice(8,-1)},objId:function(e){return e.__id||Object.defineProperty(e,"__id",{value:++YL}),e.__id},clone:function e(t,n){n=n||{};var r,s;switch(Xt.util.type(t)){case"Object":if(s=Xt.util.objId(t),n[s])return n[s];r={},n[s]=r;for(var i in t)t.hasOwnProperty(i)&&(r[i]=e(t[i],n));return r;case"Array":return s=Xt.util.objId(t),n[s]?n[s]:(r=[],n[s]=r,t.forEach(function(o,l){r[l]=e(o,n)}),r);default:return t}}},languages:{plain:No,plaintext:No,text:No,txt:No,extend:function(e,t){var n=Xt.util.clone(Xt.languages[e]);for(var r in t)n[r]=t[r];return n},insertBefore:function(e,t,n,r){r=r||Xt.languages;var s=r[e],i={};for(var o in s)if(s.hasOwnProperty(o)){if(o==t)for(var l in n)n.hasOwnProperty(l)&&(i[l]=n[l]);n.hasOwnProperty(o)||(i[o]=s[o])}var u=r[e];return r[e]=i,Xt.languages.DFS(Xt.languages,function(c,d){d===u&&c!=e&&(this[c]=i)}),i},DFS:function e(t,n,r,s){s=s||{};var i=Xt.util.objId;for(var o in t)if(t.hasOwnProperty(o)){n.call(t,o,t[o],r||o);var l=t[o],u=Xt.util.type(l);u==="Object"&&!s[i(l)]?(s[i(l)]=!0,e(l,n,null,s)):u==="Array"&&!s[i(l)]&&(s[i(l)]=!0,e(l,n,o,s))}}},plugins:{},highlight:function(e,t,n){var r={code:e,grammar:t,language:n};if(Xt.hooks.run("before-tokenize",r),!r.grammar)throw new Error('The language "'+r.language+'" has no grammar.');return r.tokens=Xt.tokenize(r.code,r.grammar),Xt.hooks.run("after-tokenize",r),ei.stringify(Xt.util.encode(r.tokens),r.language)},tokenize:function(e,t){var n=t.rest;if(n){for(var r in n)t[r]=n[r];delete t.rest}var s=new KL;return Xo(s,s.head,e),ZS(e,s,t,s.head,0),XL(s)},hooks:{all:{},add:function(e,t){var n=Xt.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=Xt.hooks.all[e];if(!(!n||!n.length))for(var r=0,s;s=n[r++];)s(t)}},Token:ei};function ei(e,t,n,r){this.type=e,this.content=t,this.alias=n,this.length=(r||"").length|0}function N0(e,t,n,r){e.lastIndex=t;var s=e.exec(n);if(s&&r&&s[1]){var i=s[1].length;s.index+=i,s[0]=s[0].slice(i)}return s}function ZS(e,t,n,r,s,i){for(var o in n)if(!(!n.hasOwnProperty(o)||!n[o])){var l=n[o];l=Array.isArray(l)?l:[l];for(var u=0;u<l.length;++u){if(i&&i.cause==o+","+u)return;var c=l[u],d=c.inside,p=!!c.lookbehind,f=!!c.greedy,m=c.alias;if(f&&!c.pattern.global){var b=c.pattern.toString().match(/[imsuy]*$/)[0];c.pattern=RegExp(c.pattern.source,b+"g")}for(var x=c.pattern||c,y=r.next,E=s;y!==t.tail&&!(i&&E>=i.reach);E+=y.value.length,y=y.next){var v=y.value;if(t.length>e.length)return;if(!(v instanceof ei)){var S=1,A;if(f){if(A=N0(x,E,e,p),!A||A.index>=e.length)break;var k=A.index,N=A.index+A[0].length,T=E;for(T+=y.value.length;k>=T;)y=y.next,T+=y.value.length;if(T-=y.value.length,E=T,y.value instanceof ei)continue;for(var w=y;w!==t.tail&&(T<N||typeof w.value=="string");w=w.next)S++,T+=w.value.length;S--,v=e.slice(E,T),A.index-=E}else if(A=N0(x,0,v,p),!A)continue;var k=A.index,F=A[0],C=v.slice(0,k),$=v.slice(k+F.length),z=E+v.length;i&&z>i.reach&&(i.reach=z);var M=y.prev;C&&(M=Xo(t,M,C),E+=C.length),ZL(t,M,S);var G=new ei(o,d?Xt.tokenize(F,d):F,m,F);if(y=Xo(t,M,G),$&&Xo(t,y,$),S>1){var H={cause:o+","+u,reach:z};ZS(e,t,n,y.prev,E,H),i&&H.reach>i.reach&&(i.reach=H.reach)}}}}}}function KL(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function Xo(e,t,n){var r=t.next,s={value:n,prev:t,next:r};return t.next=s,r.prev=s,e.length++,s}function ZL(e,t,n){for(var r=t.next,s=0;s<n&&r!==e.tail;s++)r=r.next;t.next=r,r.prev=t,e.length-=s}function XL(e){for(var t=[],n=e.head.next;n!==e.tail;)t.push(n.value),n=n.next;return t}const XS=Xt;function QS(){}QS.prototype=XS;const _=new QS;_.highlight=QL;_.register=JL;_.alias=e3;_.registered=t3;_.listLanguages=n3;_.util.encode=r3;_.Token.stringify=Ed;function QL(e,t){if(typeof e!="string")throw new TypeError("Expected `string` for `value`, got `"+e+"`");let n,r;if(t&&typeof t=="object")n=t;else{if(r=t,typeof r!="string")throw new TypeError("Expected `string` for `name`, got `"+r+"`");if(Object.hasOwn(_.languages,r))n=_.languages[r];else throw new Error("Unknown language: `"+r+"` is not registered")}return{type:"root",children:XS.highlight.call(_,e,n,r)}}function JL(e){if(typeof e!="function"||!e.displayName)throw new Error("Expected `function` for `syntax`, got `"+e+"`");Object.hasOwn(_.languages,e.displayName)||e(_)}function e3(e,t){const n=_.languages;let r={};typeof e=="string"?t&&(r[e]=t):r=e;let s;for(s in r)if(Object.hasOwn(r,s)){const i=r[s],o=typeof i=="string"?[i]:i;let l=-1;for(;++l<o.length;)n[o[l]]=n[s]}}function t3(e){if(typeof e!="string")throw new TypeError("Expected `string` for `aliasOrLanguage`, got `"+e+"`");return Object.hasOwn(_.languages,e)}function n3(){const e=_.languages,t=[];let n;for(n in e)Object.hasOwn(e,n)&&typeof e[n]=="object"&&t.push(n);return t}function Ed(e,t){if(typeof e=="string")return{type:"text",value:e};if(Array.isArray(e)){const r=[];let s=-1;for(;++s<e.length;)e[s]!==null&&e[s]!==void 0&&e[s]!==""&&r.push(Ed(e[s],t));return r}const n={attributes:{},classes:["token",e.type],content:Ed(e.content,t),language:t,tag:"span",type:e.type};return e.alias&&n.classes.push(...typeof e.alias=="string"?[e.alias]:e.alias),_.hooks.run("wrap",n),VS(n.tag+"."+n.classes.join("."),s3(n.attributes),n.content)}function r3(e){return e}function s3(e){let t;for(t in e)Object.hasOwn(e,t)&&(e[t]=WL(e[t]));return e}_.register(rt);_.register(Yn);_.register(ps);_.register(Jl);_.register($i);_.register(fs);_.register(rn);_.register(Hr);_.register(eu);_.register(tu);_.register(nu);_.register(ms);_.register(ru);_.register(cn);_.register(pa);_.register(su);_.register(au);_.register(zi);_.register(iu);_.register(Hi);_.register(ou);_.register(lu);_.register(uu);_.register(dn);_.register(hs);_.register(Gi);_.register(cu);_.register(gs);_.register(du);_.register(pu);_.register(fu);_.register(fa);_.register(mu);_.register(ma);_.register(Wi);_.register(qi);wp.displayName="abap";wp.aliases=[];function wp(e){e.languages.abap={comment:/^\*.*/m,string:/(`|')(?:\\.|(?!\1)[^\\\r\n])*\1/,"string-template":{pattern:/([|}])(?:\\.|[^\\|{\r\n])*(?=[|{])/,lookbehind:!0,alias:"string"},"eol-comment":{pattern:/(^|\s)".*/m,lookbehind:!0,alias:"comment"},keyword:{pattern:/(\s|\.|^)(?:\*-INPUT|\?TO|ABAP-SOURCE|ABBREVIATED|ABS|ABSTRACT|ACCEPT|ACCEPTING|ACCESSPOLICY|ACCORDING|ACOS|ACTIVATION|ACTUAL|ADD|ADD-CORRESPONDING|ADJACENT|AFTER|ALIAS|ALIASES|ALIGN|ALL|ALLOCATE|ALPHA|ANALYSIS|ANALYZER|AND|ANY|APPEND|APPENDAGE|APPENDING|APPLICATION|ARCHIVE|AREA|ARITHMETIC|AS|ASCENDING|ASIN|ASPECT|ASSERT|ASSIGN|ASSIGNED|ASSIGNING|ASSOCIATION|ASYNCHRONOUS|AT|ATAN|ATTRIBUTES|AUTHORITY|AUTHORITY-CHECK|AVG|BACK|BACKGROUND|BACKUP|BACKWARD|BADI|BASE|BEFORE|BEGIN|BETWEEN|BIG|BINARY|BINDING|BIT|BIT-AND|BIT-NOT|BIT-OR|BIT-XOR|BLACK|BLANK|BLANKS|BLOB|BLOCK|BLOCKS|BLUE|BOUND|BOUNDARIES|BOUNDS|BOXED|BREAK-POINT|BT|BUFFER|BY|BYPASSING|BYTE|BYTE-CA|BYTE-CN|BYTE-CO|BYTE-CS|BYTE-NA|BYTE-NS|BYTE-ORDER|C|CA|CALL|CALLING|CASE|CAST|CASTING|CATCH|CEIL|CENTER|CENTERED|CHAIN|CHAIN-INPUT|CHAIN-REQUEST|CHANGE|CHANGING|CHANNELS|CHAR-TO-HEX|CHARACTER|CHARLEN|CHECK|CHECKBOX|CIRCULAR|CI_|CLASS|CLASS-CODING|CLASS-DATA|CLASS-EVENTS|CLASS-METHODS|CLASS-POOL|CLEANUP|CLEAR|CLIENT|CLOB|CLOCK|CLOSE|CN|CNT|CO|COALESCE|CODE|CODING|COLLECT|COLOR|COLUMN|COLUMNS|COL_BACKGROUND|COL_GROUP|COL_HEADING|COL_KEY|COL_NEGATIVE|COL_NORMAL|COL_POSITIVE|COL_TOTAL|COMMENT|COMMENTS|COMMIT|COMMON|COMMUNICATION|COMPARING|COMPONENT|COMPONENTS|COMPRESSION|COMPUTE|CONCAT|CONCATENATE|COND|CONDENSE|CONDITION|CONNECT|CONNECTION|CONSTANTS|CONTEXT|CONTEXTS|CONTINUE|CONTROL|CONTROLS|CONV|CONVERSION|CONVERT|COPIES|COPY|CORRESPONDING|COS|COSH|COUNT|COUNTRY|COVER|CP|CPI|CREATE|CREATING|CRITICAL|CS|CURRENCY|CURRENCY_CONVERSION|CURRENT|CURSOR|CURSOR-SELECTION|CUSTOMER|CUSTOMER-FUNCTION|DANGEROUS|DATA|DATABASE|DATAINFO|DATASET|DATE|DAYLIGHT|DBMAXLEN|DD\/MM\/YY|DD\/MM\/YYYY|DDMMYY|DEALLOCATE|DECIMALS|DECIMAL_SHIFT|DECLARATIONS|DEEP|DEFAULT|DEFERRED|DEFINE|DEFINING|DEFINITION|DELETE|DELETING|DEMAND|DEPARTMENT|DESCENDING|DESCRIBE|DESTINATION|DETAIL|DIALOG|DIRECTORY|DISCONNECT|DISPLAY|DISPLAY-MODE|DISTANCE|DISTINCT|DIV|DIVIDE|DIVIDE-CORRESPONDING|DIVISION|DO|DUMMY|DUPLICATE|DUPLICATES|DURATION|DURING|DYNAMIC|DYNPRO|E|EACH|EDIT|EDITOR-CALL|ELSE|ELSEIF|EMPTY|ENABLED|ENABLING|ENCODING|END|END-ENHANCEMENT-SECTION|END-LINES|END-OF-DEFINITION|END-OF-FILE|END-OF-PAGE|END-OF-SELECTION|ENDAT|ENDCASE|ENDCATCH|ENDCHAIN|ENDCLASS|ENDDO|ENDENHANCEMENT|ENDEXEC|ENDFOR|ENDFORM|ENDFUNCTION|ENDIAN|ENDIF|ENDING|ENDINTERFACE|ENDLOOP|ENDMETHOD|ENDMODULE|ENDON|ENDPROVIDE|ENDSELECT|ENDTRY|ENDWHILE|ENGINEERING|ENHANCEMENT|ENHANCEMENT-POINT|ENHANCEMENT-SECTION|ENHANCEMENTS|ENTRIES|ENTRY|ENVIRONMENT|EQ|EQUAL|EQUIV|ERRORMESSAGE|ERRORS|ESCAPE|ESCAPING|EVENT|EVENTS|EXACT|EXCEPT|EXCEPTION|EXCEPTION-TABLE|EXCEPTIONS|EXCLUDE|EXCLUDING|EXEC|EXECUTE|EXISTS|EXIT|EXIT-COMMAND|EXP|EXPAND|EXPANDING|EXPIRATION|EXPLICIT|EXPONENT|EXPORT|EXPORTING|EXTEND|EXTENDED|EXTENSION|EXTRACT|FAIL|FETCH|FIELD|FIELD-GROUPS|FIELD-SYMBOL|FIELD-SYMBOLS|FIELDS|FILE|FILTER|FILTER-TABLE|FILTERS|FINAL|FIND|FIRST|FIRST-LINE|FIXED-POINT|FKEQ|FKGE|FLOOR|FLUSH|FONT|FOR|FORM|FORMAT|FORWARD|FOUND|FRAC|FRAME|FRAMES|FREE|FRIENDS|FROM|FUNCTION|FUNCTION-POOL|FUNCTIONALITY|FURTHER|GAPS|GE|GENERATE|GET|GIVING|GKEQ|GKGE|GLOBAL|GRANT|GREATER|GREEN|GROUP|GROUPS|GT|HANDLE|HANDLER|HARMLESS|HASHED|HAVING|HDB|HEAD-LINES|HEADER|HEADERS|HEADING|HELP-ID|HELP-REQUEST|HIDE|HIGH|HINT|HOLD|HOTSPOT|I|ICON|ID|IDENTIFICATION|IDENTIFIER|IDS|IF|IGNORE|IGNORING|IMMEDIATELY|IMPLEMENTATION|IMPLEMENTATIONS|IMPLEMENTED|IMPLICIT|IMPORT|IMPORTING|IN|INACTIVE|INCL|INCLUDE|INCLUDES|INCLUDING|INCREMENT|INDEX|INDEX-LINE|INFOTYPES|INHERITING|INIT|INITIAL|INITIALIZATION|INNER|INOUT|INPUT|INSERT|INSTANCES|INTENSIFIED|INTERFACE|INTERFACE-POOL|INTERFACES|INTERNAL|INTERVALS|INTO|INVERSE|INVERTED-DATE|IS|ISO|ITERATOR|ITNO|JOB|JOIN|KEEP|KEEPING|KERNEL|KEY|KEYS|KEYWORDS|KIND|LANGUAGE|LAST|LATE|LAYOUT|LE|LEADING|LEAVE|LEFT|LEFT-JUSTIFIED|LEFTPLUS|LEFTSPACE|LEGACY|LENGTH|LESS|LET|LEVEL|LEVELS|LIKE|LINE|LINE-COUNT|LINE-SELECTION|LINE-SIZE|LINEFEED|LINES|LIST|LIST-PROCESSING|LISTBOX|LITTLE|LLANG|LOAD|LOAD-OF-PROGRAM|LOB|LOCAL|LOCALE|LOCATOR|LOG|LOG-POINT|LOG10|LOGFILE|LOGICAL|LONG|LOOP|LOW|LOWER|LPAD|LPI|LT|M|MAIL|MAIN|MAJOR-ID|MAPPING|MARGIN|MARK|MASK|MATCH|MATCHCODE|MAX|MAXIMUM|MEDIUM|MEMBERS|MEMORY|MESH|MESSAGE|MESSAGE-ID|MESSAGES|MESSAGING|METHOD|METHODS|MIN|MINIMUM|MINOR-ID|MM\/DD\/YY|MM\/DD\/YYYY|MMDDYY|MOD|MODE|MODIF|MODIFIER|MODIFY|MODULE|MOVE|MOVE-CORRESPONDING|MULTIPLY|MULTIPLY-CORRESPONDING|NA|NAME|NAMETAB|NATIVE|NB|NE|NESTED|NESTING|NEW|NEW-LINE|NEW-PAGE|NEW-SECTION|NEXT|NO|NO-DISPLAY|NO-EXTENSION|NO-GAP|NO-GAPS|NO-GROUPING|NO-HEADING|NO-SCROLLING|NO-SIGN|NO-TITLE|NO-TOPOFPAGE|NO-ZERO|NODE|NODES|NON-UNICODE|NON-UNIQUE|NOT|NP|NS|NULL|NUMBER|NUMOFCHAR|O|OBJECT|OBJECTS|OBLIGATORY|OCCURRENCE|OCCURRENCES|OCCURS|OF|OFF|OFFSET|OLE|ON|ONLY|OPEN|OPTION|OPTIONAL|OPTIONS|OR|ORDER|OTHER|OTHERS|OUT|OUTER|OUTPUT|OUTPUT-LENGTH|OVERFLOW|OVERLAY|PACK|PACKAGE|PAD|PADDING|PAGE|PAGES|PARAMETER|PARAMETER-TABLE|PARAMETERS|PART|PARTIALLY|PATTERN|PERCENTAGE|PERFORM|PERFORMING|PERSON|PF|PF-STATUS|PINK|PLACES|POOL|POSITION|POS_HIGH|POS_LOW|PRAGMAS|PRECOMPILED|PREFERRED|PRESERVING|PRIMARY|PRINT|PRINT-CONTROL|PRIORITY|PRIVATE|PROCEDURE|PROCESS|PROGRAM|PROPERTY|PROTECTED|PROVIDE|PUBLIC|PUSHBUTTON|PUT|QUEUE-ONLY|QUICKINFO|RADIOBUTTON|RAISE|RAISING|RANGE|RANGES|RAW|READ|READ-ONLY|READER|RECEIVE|RECEIVED|RECEIVER|RECEIVING|RED|REDEFINITION|REDUCE|REDUCED|REF|REFERENCE|REFRESH|REGEX|REJECT|REMOTE|RENAMING|REPLACE|REPLACEMENT|REPLACING|REPORT|REQUEST|REQUESTED|RESERVE|RESET|RESOLUTION|RESPECTING|RESPONSIBLE|RESULT|RESULTS|RESUMABLE|RESUME|RETRY|RETURN|RETURNCODE|RETURNING|RIGHT|RIGHT-JUSTIFIED|RIGHTPLUS|RIGHTSPACE|RISK|RMC_COMMUNICATION_FAILURE|RMC_INVALID_STATUS|RMC_SYSTEM_FAILURE|ROLE|ROLLBACK|ROUND|ROWS|RTTI|RUN|SAP|SAP-SPOOL|SAVING|SCALE_PRESERVING|SCALE_PRESERVING_SCIENTIFIC|SCAN|SCIENTIFIC|SCIENTIFIC_WITH_LEADING_ZERO|SCREEN|SCROLL|SCROLL-BOUNDARY|SCROLLING|SEARCH|SECONDARY|SECONDS|SECTION|SELECT|SELECT-OPTIONS|SELECTION|SELECTION-SCREEN|SELECTION-SET|SELECTION-SETS|SELECTION-TABLE|SELECTIONS|SELECTOR|SEND|SEPARATE|SEPARATED|SET|SHARED|SHIFT|SHORT|SHORTDUMP-ID|SIGN|SIGN_AS_POSTFIX|SIMPLE|SIN|SINGLE|SINH|SIZE|SKIP|SKIPPING|SMART|SOME|SORT|SORTABLE|SORTED|SOURCE|SPACE|SPECIFIED|SPLIT|SPOOL|SPOTS|SQL|SQLSCRIPT|SQRT|STABLE|STAMP|STANDARD|START-OF-SELECTION|STARTING|STATE|STATEMENT|STATEMENTS|STATIC|STATICS|STATUSINFO|STEP-LOOP|STOP|STRLEN|STRUCTURE|STRUCTURES|STYLE|SUBKEY|SUBMATCHES|SUBMIT|SUBROUTINE|SUBSCREEN|SUBSTRING|SUBTRACT|SUBTRACT-CORRESPONDING|SUFFIX|SUM|SUMMARY|SUMMING|SUPPLIED|SUPPLY|SUPPRESS|SWITCH|SWITCHSTATES|SYMBOL|SYNCPOINTS|SYNTAX|SYNTAX-CHECK|SYNTAX-TRACE|SYSTEM-CALL|SYSTEM-EXCEPTIONS|SYSTEM-EXIT|TAB|TABBED|TABLE|TABLES|TABLEVIEW|TABSTRIP|TAN|TANH|TARGET|TASK|TASKS|TEST|TESTING|TEXT|TEXTPOOL|THEN|THROW|TIME|TIMES|TIMESTAMP|TIMEZONE|TITLE|TITLE-LINES|TITLEBAR|TO|TOKENIZATION|TOKENS|TOP-LINES|TOP-OF-PAGE|TRACE-FILE|TRACE-TABLE|TRAILING|TRANSACTION|TRANSFER|TRANSFORMATION|TRANSLATE|TRANSPORTING|TRMAC|TRUNC|TRUNCATE|TRUNCATION|TRY|TYPE|TYPE-POOL|TYPE-POOLS|TYPES|ULINE|UNASSIGN|UNDER|UNICODE|UNION|UNIQUE|UNIT|UNIT_CONVERSION|UNIX|UNPACK|UNTIL|UNWIND|UP|UPDATE|UPPER|USER|USER-COMMAND|USING|UTF-8|VALID|VALUE|VALUE-REQUEST|VALUES|VARY|VARYING|VERIFICATION-MESSAGE|VERSION|VIA|VIEW|VISIBLE|WAIT|WARNING|WHEN|WHENEVER|WHERE|WHILE|WIDTH|WINDOW|WINDOWS|WITH|WITH-HEADING|WITH-TITLE|WITHOUT|WORD|WORK|WRITE|WRITER|X|XML|XOR|XSD|XSTRLEN|YELLOW|YES|YYMMDD|Z|ZERO|ZONE)(?![\w-])/i,lookbehind:!0},number:/\b\d+\b/,operator:{pattern:/(\s)(?:\*\*?|<[=>]?|>=?|\?=|[-+\/=])(?=\s)/,lookbehind:!0},"string-operator":{pattern:/(\s)&&?(?=\s)/,lookbehind:!0,alias:"keyword"},"token-operator":[{pattern:/(\w)(?:->?|=>|[~|{}])(?=\w)/,lookbehind:!0,alias:"punctuation"},{pattern:/[|{}]/,alias:"punctuation"}],punctuation:/[,.:()]/}}vp.displayName="abnf";vp.aliases=[];function vp(e){(function(t){var n="(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)";t.languages.abnf={comment:/;.*/,string:{pattern:/(?:%[is])?"[^"\n\r]*"/,greedy:!0,inside:{punctuation:/^%[is]/}},range:{pattern:/%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i,alias:"number"},terminal:{pattern:/%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i,alias:"number"},repetition:{pattern:/(^|[^\w-])(?:\d*\*\d*|\d+)/,lookbehind:!0,alias:"operator"},definition:{pattern:/(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m,lookbehind:!0,alias:"keyword",inside:{punctuation:/<|>/}},"core-rule":{pattern:RegExp("(?:(^|[^<\\w-])"+n+"|<"+n+">)(?![\\w-])","i"),lookbehind:!0,alias:["rule","constant"],inside:{punctuation:/<|>/}},rule:{pattern:/(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i,lookbehind:!0,inside:{punctuation:/<|>/}},operator:/=\/?|\//,punctuation:/[()\[\]]/}})(e)}Ap.displayName="actionscript";Ap.aliases=[];function Ap(e){e.register(cn),e.languages.actionscript=e.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),e.languages.actionscript["class-name"].alias="function",delete e.languages.actionscript.parameter,delete e.languages.actionscript["literal-property"],e.languages.markup&&e.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:e.languages.markup}})}kp.displayName="ada";kp.aliases=[];function kp(e){e.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/,number:[{pattern:/\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i},{pattern:/\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i}],attribute:{pattern:/\b'\w+/,alias:"attr-name"},keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,boolean:/\b(?:false|true)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,char:/'.'/,variable:/\b[a-z](?:\w)*\b/i}}_p.displayName="agda";_p.aliases=[];function _p(e){(function(t){t.languages.agda={comment:/\{-[\s\S]*?(?:-\}|$)|--.*/,string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},punctuation:/[(){}⦃⦄.;@]/,"class-name":{pattern:/((?:data|record) +)\S+/,lookbehind:!0},function:{pattern:/(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m,lookbehind:!0},operator:{pattern:/(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/,lookbehind:!0},keyword:/\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/}})(e)}Cp.displayName="al";Cp.aliases=[];function Cp(e){e.languages.al={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},function:{pattern:/(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i,lookbehind:!0},keyword:[/\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i,/\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i],number:/\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|LL?|U(?:LL?)?)?\b/i,boolean:/\b(?:false|true)\b/i,variable:/\b(?:Curr(?:FieldNo|Page|Report)|x?Rec|RequestOptionsPage)\b/,"class-name":/\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i,operator:/\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i,punctuation:/[()\[\]{}:.;,]/}}Ip.displayName="antlr4";Ip.aliases=["g4"];function Ip(e){e.languages.antlr4={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,string:{pattern:/'(?:\\.|[^\\'\r\n])*'/,greedy:!0},"character-class":{pattern:/\[(?:\\.|[^\\\]\r\n])*\]/,greedy:!0,alias:"regex",inside:{range:{pattern:/([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,lookbehind:!0,alias:"punctuation"},escape:/\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,punctuation:/[\[\]]/}},action:{pattern:/\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,greedy:!0,inside:{content:{pattern:/(\{)[\s\S]+(?=\})/,lookbehind:!0},punctuation:/[{}]/}},command:{pattern:/(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,lookbehind:!0,inside:{function:/\b\w+(?=\s*(?:[,(]|$))/,punctuation:/[,()]/}},annotation:{pattern:/@\w+(?:::\w+)*/,alias:"keyword"},label:{pattern:/#[ \t]*\w+/,alias:"punctuation"},keyword:/\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,definition:[{pattern:/\b[a-z]\w*(?=\s*:)/,alias:["rule","class-name"]},{pattern:/\b[A-Z]\w*(?=\s*:)/,alias:["token","constant"]}],constant:/\b[A-Z][A-Z_]*\b/,operator:/\.\.|->|[|~]|[*+?]\??/,punctuation:/[;:()=]/},e.languages.g4=e.languages.antlr4}Rp.displayName="apacheconf";Rp.aliases=[];function Rp(e){e.languages.apacheconf={comment:/#.*/,"directive-inline":{pattern:/(^[\t ]*)\b(?:AcceptFilter|AcceptPathInfo|AccessFileName|Action|Add(?:Alt|AltByEncoding|AltByType|Charset|DefaultCharset|Description|Encoding|Handler|Icon|IconByEncoding|IconByType|InputFilter|Language|ModuleInfo|OutputFilter|OutputFilterByType|Type)|Alias|AliasMatch|Allow(?:CONNECT|EncodedSlashes|Methods|Override|OverrideList)?|Anonymous(?:_LogEmail|_MustGiveEmail|_NoUserID|_VerifyEmail)?|AsyncRequestWorkerFactor|Auth(?:BasicAuthoritative|BasicFake|BasicProvider|BasicUseDigestAlgorithm|DBDUserPWQuery|DBDUserRealmQuery|DBMGroupFile|DBMType|DBMUserFile|Digest(?:Algorithm|Domain|NonceLifetime|Provider|Qop|ShmemSize)|Form(?:Authoritative|Body|DisableNoStore|FakeBasicAuth|Location|LoginRequiredLocation|LoginSuccessLocation|LogoutLocation|Method|Mimetype|Password|Provider|SitePassphrase|Size|Username)|GroupFile|LDAP(?:AuthorizePrefix|BindAuthoritative|BindDN|BindPassword|CharsetConfig|CompareAsUser|CompareDNOnServer|DereferenceAliases|GroupAttribute|GroupAttributeIsDN|InitialBindAsUser|InitialBindPattern|MaxSubGroupDepth|RemoteUserAttribute|RemoteUserIsDN|SearchAsUser|SubGroupAttribute|SubGroupClass|Url)|Merging|Name|nCache(?:Context|Enable|ProvideFor|SOCache|Timeout)|nzFcgiCheckAuthnProvider|nzFcgiDefineProvider|Type|UserFile|zDBDLoginToReferer|zDBDQuery|zDBDRedirectQuery|zDBMType|zSendForbiddenOnFailure)|BalancerGrowth|BalancerInherit|BalancerMember|BalancerPersist|BrowserMatch|BrowserMatchNoCase|BufferedLogs|BufferSize|Cache(?:DefaultExpire|DetailHeader|DirLength|DirLevels|Disable|Enable|File|Header|IgnoreCacheControl|IgnoreHeaders|IgnoreNoLastMod|IgnoreQueryString|IgnoreURLSessionIdentifiers|KeyBaseURL|LastModifiedFactor|Lock|LockMaxAge|LockPath|MaxExpire|MaxFileSize|MinExpire|MinFileSize|NegotiatedDocs|QuickHandler|ReadSize|ReadTime|Root|Socache(?:MaxSize|MaxTime|MinTime|ReadSize|ReadTime)?|StaleOnError|StoreExpired|StoreNoStore|StorePrivate)|CGIDScriptTimeout|CGIMapExtension|CharsetDefault|CharsetOptions|CharsetSourceEnc|CheckCaseOnly|CheckSpelling|ChrootDir|ContentDigest|CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking|CoreDumpDirectory|CustomLog|Dav|DavDepthInfinity|DavGenericLockDB|DavLockDB|DavMinTimeout|DBDExptime|DBDInitSQL|DBDKeep|DBDMax|DBDMin|DBDParams|DBDPersist|DBDPrepareSQL|DBDriver|DefaultIcon|DefaultLanguage|DefaultRuntimeDir|DefaultType|Define|Deflate(?:BufferSize|CompressionLevel|FilterNote|InflateLimitRequestBody|InflateRatio(?:Burst|Limit)|MemLevel|WindowSize)|Deny|DirectoryCheckHandler|DirectoryIndex|DirectoryIndexRedirect|DirectorySlash|DocumentRoot|DTracePrivileges|DumpIOInput|DumpIOOutput|EnableExceptionHook|EnableMMAP|EnableSendfile|Error|ErrorDocument|ErrorLog|ErrorLogFormat|Example|ExpiresActive|ExpiresByType|ExpiresDefault|ExtendedStatus|ExtFilterDefine|ExtFilterOptions|FallbackResource|FileETag|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace|ForceLanguagePriority|ForceType|ForensicLog|GprofDir|GracefulShutdownTimeout|Group|Header|HeaderName|Heartbeat(?:Address|Listen|MaxServers|Storage)|HostnameLookups|IdentityCheck|IdentityCheckTimeout|ImapBase|ImapDefault|ImapMenu|Include|IncludeOptional|Index(?:HeadInsert|Ignore|IgnoreReset|Options|OrderDefault|StyleSheet)|InputSed|ISAPI(?:AppendLogToErrors|AppendLogToQuery|CacheFile|FakeAsync|LogNotSupported|ReadAheadBuffer)|KeepAlive|KeepAliveTimeout|KeptBodySize|LanguagePriority|LDAP(?:CacheEntries|CacheTTL|ConnectionPoolTTL|ConnectionTimeout|LibraryDebug|OpCacheEntries|OpCacheTTL|ReferralHopLimit|Referrals|Retries|RetryDelay|SharedCacheFile|SharedCacheSize|Timeout|TrustedClientCert|TrustedGlobalCert|TrustedMode|VerifyServerCert)|Limit(?:InternalRecursion|Request(?:Body|Fields|FieldSize|Line)|XMLRequestBody)|Listen|ListenBackLog|LoadFile|LoadModule|LogFormat|LogLevel|LogMessage|LuaAuthzProvider|LuaCodeCache|Lua(?:Hook(?:AccessChecker|AuthChecker|CheckUserID|Fixups|InsertFilter|Log|MapToStorage|TranslateName|TypeChecker)|Inherit|InputFilter|MapHandler|OutputFilter|PackageCPath|PackagePath|QuickHandler|Root|Scope)|Max(?:ConnectionsPerChild|KeepAliveRequests|MemFree|RangeOverlaps|RangeReversals|Ranges|RequestWorkers|SpareServers|SpareThreads|Threads)|MergeTrailers|MetaDir|MetaFiles|MetaSuffix|MimeMagicFile|MinSpareServers|MinSpareThreads|MMapFile|ModemStandard|ModMimeUsePathInfo|MultiviewsMatch|Mutex|NameVirtualHost|NoProxy|NWSSLTrustedCerts|NWSSLUpgradeable|Options|Order|OutputSed|PassEnv|PidFile|PrivilegesMode|Protocol|ProtocolEcho|Proxy(?:AddHeaders|BadHeader|Block|Domain|ErrorOverride|ExpressDBMFile|ExpressDBMType|ExpressEnable|FtpDirCharset|FtpEscapeWildcards|FtpListOnWildcard|HTML(?:BufSize|CharsetOut|DocType|Enable|Events|Extended|Fixups|Interp|Links|Meta|StripComments|URLMap)|IOBufferSize|MaxForwards|Pass(?:Inherit|InterpolateEnv|Match|Reverse|ReverseCookieDomain|ReverseCookiePath)?|PreserveHost|ReceiveBufferSize|Remote|RemoteMatch|Requests|SCGIInternalRedirect|SCGISendfile|Set|SourceAddress|Status|Timeout|Via)|ReadmeName|ReceiveBufferSize|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ReflectorHeader|RemoteIP(?:Header|InternalProxy|InternalProxyList|ProxiesHeader|TrustedProxy|TrustedProxyList)|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|RequestHeader|RequestReadTimeout|Require|Rewrite(?:Base|Cond|Engine|Map|Options|Rule)|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScoreBoardFile|Script(?:Alias|AliasMatch|InterpreterSource|Log|LogBuffer|LogLength|Sock)?|SecureListen|SeeRequestTail|SendBufferSize|Server(?:Admin|Alias|Limit|Name|Path|Root|Signature|Tokens)|Session(?:Cookie(?:Name|Name2|Remove)|Crypto(?:Cipher|Driver|Passphrase|PassphraseFile)|DBD(?:CookieName|CookieName2|CookieRemove|DeleteLabel|InsertLabel|PerUser|SelectLabel|UpdateLabel)|Env|Exclude|Header|Include|MaxAge)?|SetEnv|SetEnvIf|SetEnvIfExpr|SetEnvIfNoCase|SetHandler|SetInputFilter|SetOutputFilter|SSIEndTag|SSIErrorMsg|SSIETag|SSILastModified|SSILegacyExprParser|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|SSL(?:CACertificateFile|CACertificatePath|CADNRequestFile|CADNRequestPath|CARevocationCheck|CARevocationFile|CARevocationPath|CertificateChainFile|CertificateFile|CertificateKeyFile|CipherSuite|Compression|CryptoDevice|Engine|FIPS|HonorCipherOrder|InsecureRenegotiation|OCSP(?:DefaultResponder|Enable|OverrideResponder|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|UseRequestNonce)|OpenSSLConfCmd|Options|PassPhraseDialog|Protocol|Proxy(?:CACertificateFile|CACertificatePath|CARevocation(?:Check|File|Path)|CheckPeer(?:CN|Expire|Name)|CipherSuite|Engine|MachineCertificate(?:ChainFile|File|Path)|Protocol|Verify|VerifyDepth)|RandomSeed|RenegBufferSize|Require|RequireSSL|Session(?:Cache|CacheTimeout|TicketKeyFile|Tickets)|SRPUnknownUserSeed|SRPVerifierFile|Stapling(?:Cache|ErrorCacheTimeout|FakeTryLater|ForceURL|ResponderTimeout|ResponseMaxAge|ResponseTimeSkew|ReturnResponderErrors|StandardCacheTimeout)|StrictSNIVHostCheck|UserName|UseStapling|VerifyClient|VerifyDepth)|StartServers|StartThreads|Substitute|Suexec|SuexecUserGroup|ThreadLimit|ThreadsPerChild|ThreadStackSize|TimeOut|TraceEnable|TransferLog|TypesConfig|UnDefine|UndefMacro|UnsetEnv|Use|UseCanonicalName|UseCanonicalPhysicalPort|User|UserDir|VHostCGIMode|VHostCGIPrivs|VHostGroup|VHostPrivs|VHostSecure|VHostUser|Virtual(?:DocumentRoot|ScriptAlias)(?:IP)?|WatchdogInterval|XBitHack|xml2EncAlias|xml2EncDefault|xml2StartParse)\b/im,lookbehind:!0,alias:"property"},"directive-block":{pattern:/<\/?\b(?:Auth[nz]ProviderAlias|Directory|DirectoryMatch|Else|ElseIf|Files|FilesMatch|If|IfDefine|IfModule|IfVersion|Limit|LimitExcept|Location|LocationMatch|Macro|Proxy|Require(?:All|Any|None)|VirtualHost)\b.*>/i,inside:{"directive-block":{pattern:/^<\/?\w+/,inside:{punctuation:/^<\/?/},alias:"tag"},"directive-block-parameter":{pattern:/.*[^>]/,inside:{punctuation:/:/,string:{pattern:/("|').*\1/,inside:{variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/}}},alias:"attr-value"},punctuation:/>/},alias:"tag"},"directive-flags":{pattern:/\[(?:[\w=],?)+\]/,alias:"keyword"},string:{pattern:/("|').*\1/,inside:{variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/}},variable:/[$%]\{?(?:\w\.?[-+:]?)+\}?/,regex:/\^?.*\$|\^.*\$?/}}Dp.displayName="apex";Dp.aliases=[];function Dp(e){e.register(rt),e.register(fa),(function(t){var n=/\b(?:(?:after|before)(?=\s+[a-z])|abstract|activate|and|any|array|as|asc|autonomous|begin|bigdecimal|blob|boolean|break|bulk|by|byte|case|cast|catch|char|class|collect|commit|const|continue|currency|date|datetime|decimal|default|delete|desc|do|double|else|end|enum|exception|exit|export|extends|final|finally|float|for|from|get(?=\s*[{};])|global|goto|group|having|hint|if|implements|import|in|inner|insert|instanceof|int|integer|interface|into|join|like|limit|list|long|loop|map|merge|new|not|null|nulls|number|object|of|on|or|outer|override|package|parallel|pragma|private|protected|public|retrieve|return|rollback|select|set|short|sObject|sort|static|string|super|switch|synchronized|system|testmethod|then|this|throw|time|transaction|transient|trigger|try|undelete|update|upsert|using|virtual|void|webservice|when|where|while|(?:inherited|with|without)\s+sharing)\b/i,r=/\b(?:(?=[a-z_]\w*\s*[<\[])|(?!<keyword>))[A-Z_]\w*(?:\s*\.\s*[A-Z_]\w*)*\b(?:\s*(?:\[\s*\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*/.source.replace(/<keyword>/g,function(){return n.source});function s(o){return RegExp(o.replace(/<CLASS-NAME>/g,function(){return r}),"i")}var i={keyword:n,punctuation:/[()\[\]{};,:.<>]/};t.languages.apex={comment:t.languages.clike.comment,string:t.languages.clike.string,sql:{pattern:/((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i,lookbehind:!0,greedy:!0,alias:"language-sql",inside:t.languages.sql},annotation:{pattern:/@\w+\b/,alias:"punctuation"},"class-name":[{pattern:s(/(\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\s+\w+\s+on)\s+)<CLASS-NAME>/.source),lookbehind:!0,inside:i},{pattern:s(/(\(\s*)<CLASS-NAME>(?=\s*\)\s*[\w(])/.source),lookbehind:!0,inside:i},{pattern:s(/<CLASS-NAME>(?=\s*\w+\s*[;=,(){:])/.source),inside:i}],trigger:{pattern:/(\btrigger\s+)\w+\b/i,lookbehind:!0,alias:"class-name"},keyword:n,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/(?:\B\.\d+|\b\d+(?:\.\d+|L)?)\b/i,operator:/[!=](?:==?)?|\?\.?|&&|\|\||--|\+\+|[-+*/^&|]=?|:|<<?=?|>{1,3}=?/,punctuation:/[()\[\]{};,.]/}})(e)}Op.displayName="apl";Op.aliases=[];function Op(e){e.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:{pattern:/'(?:[^'\r\n]|'')*'/,greedy:!0},number:/¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i,statement:/:[A-Z][a-z][A-Za-z]*\b/,"system-function":{pattern:/⎕[A-Z]+/i,alias:"function"},constant:/[⍬⌾#⎕⍞]/,function:/[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,"monadic-operator":{pattern:/[\\\/⌿⍀¨⍨⌶&∥]/,alias:"operator"},"dyadic-operator":{pattern:/[.⍣⍠⍤∘⌸@⌺⍥]/,alias:"operator"},assignment:{pattern:/←/,alias:"keyword"},punctuation:/[\[;\]()◇⋄]/,dfn:{pattern:/[{}⍺⍵⍶⍹∇⍫:]/,alias:"builtin"}}}Lp.displayName="applescript";Lp.aliases=[];function Lp(e){e.languages.applescript={comment:[/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,/--.+/,/#.+/],string:/"(?:\\.|[^"\\\r\n])*"/,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i,operator:[/[&=≠≤≥*+\-\/÷^]|[<>]=?/,/\b(?:(?:begin|end|start)s? with|(?:contains?|(?:does not|doesn't) contain)|(?:is|isn't|is not) (?:contained by|in)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:comes|(?:does not|doesn't) come) (?:after|before)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equal to|equals|is not|isn't)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|as|div|mod|not|or))\b/],keyword:/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,"class-name":/\b(?:POSIX file|RGB color|alias|application|boolean|centimeters|centimetres|class|constant|cubic centimeters|cubic centimetres|cubic feet|cubic inches|cubic meters|cubic metres|cubic yards|date|degrees Celsius|degrees Fahrenheit|degrees Kelvin|feet|file|gallons|grams|inches|integer|kilograms|kilometers|kilometres|list|liters|litres|meters|metres|miles|number|ounces|pounds|quarts|real|record|reference|script|square feet|square kilometers|square kilometres|square meters|square metres|square miles|square yards|text|yards)\b/,punctuation:/[{}():,¬«»《》]/}}jp.displayName="aql";jp.aliases=[];function jp(e){e.languages.aql={comment:/\/\/.*|\/\*[\s\S]*?\*\//,property:{pattern:/([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\.)*\1/,greedy:!0},identifier:{pattern:/([´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,greedy:!0},variable:/@@?\w+/,keyword:[{pattern:/(\bWITH\s+)COUNT(?=\s+INTO\b)/i,lookbehind:!0},/\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i,{pattern:/(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,lookbehind:!0},{pattern:/(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,lookbehind:!0},{pattern:/\bOPTIONS(?=\s*\{)/i}],function:/\b(?!\d)\w+(?=\s*\()/,boolean:/\b(?:false|true)\b/i,range:{pattern:/\.\./,alias:"operator"},number:[/\b0b[01]+/i,/\b0x[0-9a-f]+/i,/(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i],operator:/\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,punctuation:/::|[?.:,;()[\]{}]/}}Mp.displayName="arff";Mp.aliases=[];function Mp(e){e.languages.arff={comment:/%.*/,string:{pattern:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/@(?:attribute|data|end|relation)\b/i,number:/\b\d+(?:\.\d+)?\b/,punctuation:/[{},]/}}Fp.displayName="armasm";Fp.aliases=["arm-asm"];function Fp(e){e.languages.armasm={comment:{pattern:/;.*/,greedy:!0},string:{pattern:/"(?:[^"\r\n]|"")*"/,greedy:!0,inside:{variable:{pattern:/((?:^|[^$])(?:\${2})*)\$\w+/,lookbehind:!0}}},char:{pattern:/'(?:[^'\r\n]{0,4}|'')'/,greedy:!0},"version-symbol":{pattern:/\|[\w@]+\|/,greedy:!0,alias:"property"},boolean:/\b(?:FALSE|TRUE)\b/,directive:{pattern:/\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/,alias:"property"},instruction:{pattern:/((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/,lookbehind:!0,alias:"keyword"},variable:/\$\w+/,number:/(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i,register:{pattern:/\b(?:r\d|lr)\b/,alias:"symbol"},operator:/<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/,punctuation:/[()[\],]/},e.languages["arm-asm"]=e.languages.armasm}Pp.displayName="arturo";Pp.aliases=["art"];function Pp(e){(function(t){var n=function(r,s){return{pattern:RegExp(/\{!/.source+"(?:"+(s||r)+")"+/$[\s\S]*\}/.source,"m"),greedy:!0,inside:{embedded:{pattern:/(^\{!\w+\b)[\s\S]+(?=\}$)/,lookbehind:!0,alias:"language-"+r,inside:t.languages[r]},string:/[\s\S]+/}}};t.languages.arturo={comment:{pattern:/;.*/,greedy:!0},character:{pattern:/`.`/,alias:"char",greedy:!0},number:{pattern:/\b\d+(?:\.\d+(?:\.\d+(?:-[\w+-]+)?)?)?\b/},string:{pattern:/"(?:[^"\\\r\n]|\\.)*"/,greedy:!0},regex:{pattern:/\{\/.*?\/\}/,greedy:!0},"html-string":n("html"),"css-string":n("css"),"js-string":n("js"),"md-string":n("md"),"sql-string":n("sql"),"sh-string":n("shell","sh"),multistring:{pattern:/».*|\{:[\s\S]*?:\}|\{[\s\S]*?\}|^-{6}$[\s\S]*/m,alias:"string",greedy:!0},label:{pattern:/\w+\b\??:/,alias:"property"},literal:{pattern:/'(?:\w+\b\??:?)/,alias:"constant"},type:{pattern:/:(?:\w+\b\??:?)/,alias:"class-name"},color:/#\w+/,predicate:{pattern:/\b(?:all|and|any|ascii|attr|attribute|attributeLabel|binary|block|char|contains|database|date|dictionary|empty|equal|even|every|exists|false|floating|function|greater|greaterOrEqual|if|in|inline|integer|is|key|label|leap|less|lessOrEqual|literal|logical|lower|nand|negative|nor|not|notEqual|null|numeric|odd|or|path|pathLabel|positive|prefix|prime|regex|same|set|some|sorted|standalone|string|subset|suffix|superset|symbol|symbolLiteral|true|try|type|unless|upper|when|whitespace|word|xnor|xor|zero)\?/,alias:"keyword"},"builtin-function":{pattern:/\b(?:abs|acos|acosh|acsec|acsech|actan|actanh|add|after|alert|alias|and|angle|append|arg|args|arity|array|as|asec|asech|asin|asinh|atan|atan2|atanh|attr|attrs|average|before|benchmark|blend|break|call|capitalize|case|ceil|chop|clear|clip|close|color|combine|conj|continue|copy|cos|cosh|crc|csec|csech|ctan|ctanh|cursor|darken|dec|decode|define|delete|desaturate|deviation|dialog|dictionary|difference|digest|digits|div|do|download|drop|dup|e|else|empty|encode|ensure|env|escape|execute|exit|exp|extend|extract|factors|fdiv|filter|first|flatten|floor|fold|from|function|gamma|gcd|get|goto|hash|hypot|if|inc|indent|index|infinity|info|input|insert|inspect|intersection|invert|jaro|join|keys|kurtosis|last|let|levenshtein|lighten|list|ln|log|loop|lower|mail|map|match|max|median|min|mod|module|mul|nand|neg|new|nor|normalize|not|now|null|open|or|outdent|pad|palette|panic|path|pause|permissions|permutate|pi|pop|popup|pow|powerset|powmod|prefix|print|prints|process|product|query|random|range|read|relative|remove|rename|render|repeat|replace|request|return|reverse|round|sample|saturate|script|sec|sech|select|serve|set|shl|shr|shuffle|sin|sinh|size|skewness|slice|sort|spin|split|sqrt|squeeze|stack|strip|sub|suffix|sum|switch|symbols|symlink|sys|take|tan|tanh|terminal|terminate|to|truncate|try|type|unclip|union|unique|unless|until|unzip|upper|values|var|variance|volume|webview|while|with|wordwrap|write|xnor|xor|zip)\b/,alias:"keyword"},sugar:{pattern:/->|=>|\||::/,alias:"operator"},punctuation:/[()[\],]/,symbol:{pattern:/<:|-:|ø|@|#|\+|\||\*|\$|---|-|%|\/|\.\.|\^|~|=|<|>|\\/},boolean:{pattern:/\b(?:false|maybe|true)\b/}},t.languages.art=t.languages.arturo})(e)}Bp.displayName="asciidoc";Bp.aliases=["adoc"];function Bp(e){(function(t){var n={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}},r=t.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})$[\s\S]*?^\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:n,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)<?\d*>/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{function:/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:n.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:n,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|R|TM)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}};function s(i){i=i.split(" ");for(var o={},l=0,u=i.length;l<u;l++)o[i[l]]=r[i[l]];return o}n.inside.interpreted.inside.rest=s("macro inline replacement entity"),r["passthrough-block"].inside.rest=s("macro"),r["literal-block"].inside.rest=s("callout"),r.table.inside.rest=s("comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation"),r["other-block"].inside.rest=s("table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation"),r.title.inside.rest=s("macro inline replacement entity"),t.hooks.add("wrap",function(i){i.type==="entity"&&(i.attributes.title=i.content.value.replace(/&/,"&"))}),t.languages.adoc=t.languages.asciidoc})(e)}Up.displayName="aspnet";Up.aliases=[];function Up(e){e.register(fs),e.register(rn),e.languages.aspnet=e.languages.extend("markup",{"page-directive":{pattern:/<%\s*@.*%>/,alias:"tag",inside:{"page-directive":{pattern:/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,alias:"tag"},rest:e.languages.markup.tag.inside}},directive:{pattern:/<%.*%>/,alias:"tag",inside:{directive:{pattern:/<%\s*?[$=%#:]{0,2}|%>/,alias:"tag"},rest:e.languages.csharp}}}),e.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/,e.languages.insertBefore("inside","punctuation",{directive:e.languages.aspnet.directive},e.languages.aspnet.tag.inside["attr-value"]),e.languages.insertBefore("aspnet","comment",{"asp-comment":{pattern:/<%--[\s\S]*?--%>/,alias:["asp","comment"]}}),e.languages.insertBefore("aspnet",e.languages.javascript?"script":"tag",{"asp-script":{pattern:/(<script(?=.*runat=['"]?server\b)[^>]*>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,alias:["asp","script"],inside:e.languages.csharp||{}}})}$p.displayName="asm6502";$p.aliases=[];function $p(e){e.languages.asm6502={comment:/;.*/,directive:{pattern:/\.\w+(?= )/,alias:"property"},string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,"op-code":{pattern:/\b(?:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA|adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b/,alias:"keyword"},"hex-number":{pattern:/#?\$[\da-f]{1,4}\b/i,alias:"number"},"binary-number":{pattern:/#?%[01]+\b/,alias:"number"},"decimal-number":{pattern:/#?\b\d+\b/,alias:"number"},register:{pattern:/\b[xya]\b/i,alias:"variable"},punctuation:/[(),:]/}}zp.displayName="asmatmel";zp.aliases=[];function zp(e){e.languages.asmatmel={comment:{pattern:/;.*/,greedy:!0},string:{pattern:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},constant:/\b(?:PORT[A-Z]|DDR[A-Z]|(?:DD|P)[A-Z](?:\d|[0-2]\d|3[01]))\b/,directive:{pattern:/\.\w+(?= )/,alias:"property"},"r-register":{pattern:/\br(?:\d|[12]\d|3[01])\b/,alias:"variable"},"op-code":{pattern:/\b(?:ADC|ADD|ADIW|AND|ANDI|ASR|BCLR|BLD|BRBC|BRBS|BRCC|BRCS|BREAK|BREQ|BRGE|BRHC|BRHS|BRID|BRIE|BRLO|BRLT|BRMI|BRNE|BRPL|BRSH|BRTC|BRTS|BRVC|BRVS|BSET|BST|CALL|CBI|CBR|CLC|CLH|CLI|CLN|CLR|CLS|CLT|CLV|CLZ|COM|CP|CPC|CPI|CPSE|DEC|DES|EICALL|EIJMP|ELPM|EOR|FMUL|FMULS|FMULSU|ICALL|IJMP|IN|INC|JMP|LAC|LAS|LAT|LD|LD[A-Za-z0-9]|LPM|LSL|LSR|MOV|MOVW|MUL|MULS|MULSU|NEG|NOP|OR|ORI|OUT|POP|PUSH|RCALL|RET|RETI|RJMP|ROL|ROR|SBC|SBCI|SBI|SBIC|SBIS|SBIW|SBR|SBRC|SBRS|SEC|SEH|SEI|SEN|SER|SES|SET|SEV|SEZ|SLEEP|SPM|ST|ST[A-Z0-9]|SUB|SUBI|SWAP|TST|WDR|XCH|adc|add|adiw|and|andi|asr|bclr|bld|brbc|brbs|brcc|brcs|break|breq|brge|brhc|brhs|brid|brie|brlo|brlt|brmi|brne|brpl|brsh|brtc|brts|brvc|brvs|bset|bst|call|cbi|cbr|clc|clh|cli|cln|clr|cls|clt|clv|clz|com|cp|cpc|cpi|cpse|dec|des|eicall|eijmp|elpm|eor|fmul|fmuls|fmulsu|icall|ijmp|in|inc|jmp|lac|las|lat|ld|ld[a-z0-9]|lpm|lsl|lsr|mov|movw|mul|muls|mulsu|neg|nop|or|ori|out|pop|push|rcall|ret|reti|rjmp|rol|ror|sbc|sbci|sbi|sbic|sbis|sbiw|sbr|sbrc|sbrs|sec|seh|sei|sen|ser|ses|set|sev|sez|sleep|spm|st|st[a-zA-Z0-9]|sub|subi|swap|tst|wdr|xch)\b/,alias:"keyword"},"hex-number":{pattern:/#?\$[\da-f]{2,4}\b/i,alias:"number"},"binary-number":{pattern:/#?%[01]+\b/,alias:"number"},"decimal-number":{pattern:/#?\b\d+\b/,alias:"number"},register:{pattern:/\b[acznvshtixy]\b/i,alias:"variable"},operator:/>>=?|<<=?|&[&=]?|\|[\|=]?|[-+*/%^!=<>?]=?/,punctuation:/[(),:]/}}Hp.displayName="autohotkey";Hp.aliases=[];function Hp(e){e.languages.autohotkey={comment:[{pattern:/(^|\s);.*/,lookbehind:!0},{pattern:/(^[\t ]*)\/\*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m,lookbehind:!0,greedy:!0}],tag:{pattern:/^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m,lookbehind:!0},string:/"(?:[^"\n\r]|"")*"/,variable:/%\w+%/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,boolean:/\b(?:false|true)\b/,command:{pattern:/\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,alias:"selector"},constant:/\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guicontrol|a_guicontrolevent|a_guievent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel|programfiles)\b/i,builtin:/\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|isfunc|islabel|IsObject|ln|log|ltrim|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|numget|numput|onmessage|regexmatch|regexreplace|registercallback|round|rtrim|sb_seticon|sb_setparts|sb_settext|sin|sqrt|strlen|strreplace|strsplit|substr|tan|tv_add|tv_delete|tv_get|tv_getchild|tv_getcount|tv_getnext|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__Call|__Get|__New|__Set)\b/i,symbol:/\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,directive:{pattern:/#[a-z]+\b/i,alias:"important"},keyword:/\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Catch|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|Finally|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|Region|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Throw|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|Try|TryAgain|Type|UnCheck|underline|Unicode|Unlock|Until|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i,function:/[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/,punctuation:/[{}[\]():,]/}}Gp.displayName="autoit";Gp.aliases=[];function Gp(e){e.languages.autoit={comment:[/;.*/,{pattern:/(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m,lookbehind:!0}],url:{pattern:/(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,greedy:!0,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^[\t ]*)#[\w-]+/m,lookbehind:!0,alias:"keyword"},function:/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,boolean:/\b(?:False|True)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i,punctuation:/[\[\]().,:]/}}Wp.displayName="avisynth";Wp.aliases=["avs"];function Wp(e){(function(t){function n(c,d){return c.replace(/<<(\d+)>>/g,function(p,f){return d[+f]})}function r(c,d,p){return RegExp(n(c,d),p)}var s=/bool|clip|float|int|string|val/.source,i=[/is(?:bool|clip|float|int|string)|defined|(?:(?:internal)?function|var)?exists?/.source,/apply|assert|default|eval|import|nop|select|undefined/.source,/opt_(?:allowfloataudio|avipadscanlines|dwchannelmask|enable_(?:b64a|planartopackedrgb|v210|y3_10_10|y3_10_16)|usewaveextensible|vdubplanarhack)|set(?:cachemode|maxcpu|memorymax|planarlegacyalignment|workingdir)/.source,/hex(?:value)?|value/.source,/abs|ceil|continued(?:denominator|numerator)?|exp|floor|fmod|frac|log(?:10)?|max|min|muldiv|pi|pow|rand|round|sign|spline|sqrt/.source,/a?sinh?|a?cosh?|a?tan[2h]?/.source,/(?:bit(?:and|not|x?or|[lr]?shift[aslu]?|sh[lr]|sa[lr]|[lr]rotatel?|ro[rl]|te?st|set(?:count)?|cl(?:ea)?r|ch(?:an)?ge?))/.source,/average(?:[bgr]|chroma[uv]|luma)|(?:[rgb]|chroma[uv]|luma|rgb|[yuv](?=difference(?:fromprevious|tonext)))difference(?:fromprevious|tonext)?|[yuvrgb]plane(?:median|min|max|minmaxdifference)/.source,/getprocessinfo|logmsg|script(?:dir(?:utf8)?|file(?:utf8)?|name(?:utf8)?)|setlogparams/.source,/chr|(?:fill|find|left|mid|replace|rev|right)str|format|[lu]case|ord|str(?:cmpi?|fromutf8|len|toutf8)|time|trim(?:all|left|right)/.source,/isversionorgreater|version(?:number|string)/.source,/buildpixeltype|colorspacenametopixeltype/.source,/addautoloaddir|on(?:cpu|cuda)|prefetch|setfiltermtmode/.source].join("|"),o=[/has(?:audio|video)/.source,/height|width/.source,/frame(?:count|rate)|framerate(?:denominator|numerator)/.source,/getparity|is(?:field|frame)based/.source,/bitspercomponent|componentsize|hasalpha|is(?:planar(?:rgba?)?|interleaved|rgb(?:24|32|48|64)?|y(?:8|u(?:va?|y2))?|yv(?:12|16|24|411)|420|422|444|packedrgb)|numcomponents|pixeltype/.source,/audio(?:bits|channels|duration|length(?:[fs]|hi|lo)?|rate)|isaudio(?:float|int)/.source].join("|"),l=[/avi(?:file)?source|directshowsource|image(?:reader|source|sourceanim)|opendmlsource|segmented(?:avisource|directshowsource)|wavsource/.source,/coloryuv|convertbacktoyuy2|convertto(?:RGB(?:24|32|48|64)|(?:planar)?RGBA?|Y8?|YV(?:12|16|24|411)|YUVA?(?:411|420|422|444)|YUY2)|fixluminance|gr[ae]yscale|invert|levels|limiter|mergea?rgb|merge(?:chroma|luma)|rgbadjust|show(?:alpha|blue|green|red)|swapuv|tweak|[uv]toy8?|ytouv/.source,/(?:colorkey|reset)mask|layer|mask(?:hs)?|merge|overlay|subtract/.source,/addborders|(?:bicubic|bilinear|blackman|gauss|lanczos4|lanczos|point|sinc|spline(?:16|36|64))resize|crop(?:bottom)?|flip(?:horizontal|vertical)|(?:horizontal|vertical)?reduceby2|letterbox|skewrows|turn(?:180|left|right)/.source,/blur|fixbrokenchromaupsampling|generalconvolution|(?:spatial|temporal)soften|sharpen/.source,/trim|(?:un)?alignedsplice|(?:assume|assumescaled|change|convert)FPS|(?:delete|duplicate)frame|dissolve|fade(?:in|io|out)[02]?|freezeframe|interleave|loop|reverse|select(?:even|odd|(?:range)?every)/.source,/assume[bt]ff|assume(?:field|frame)based|bob|complementparity|doubleweave|peculiarblend|pulldown|separate(?:columns|fields|rows)|swapfields|weave(?:columns|rows)?/.source,/amplify(?:db)?|assumesamplerate|audiodub(?:ex)?|audiotrim|convertaudioto(?:(?:8|16|24|32)bit|float)|converttomono|delayaudio|ensurevbrmp3sync|get(?:left|right)?channel|kill(?:audio|video)|mergechannels|mixaudio|monotostereo|normalize|resampleaudio|ssrc|supereq|timestretch/.source,/animate|applyrange|conditional(?:filter|reader|select)|frameevaluate|scriptclip|tcp(?:server|source)|writefile(?:end|if|start)?/.source,/imagewriter/.source,/blackness|blankclip|colorbars(?:hd)?|compare|dumpfiltergraph|echo|histogram|info|messageclip|preroll|setgraphanalysis|show(?:framenumber|smpte|time)|showfiveversions|stack(?:horizontal|vertical)|subtitle|tone|version/.source].join("|"),u=[i,o,l].join("|");t.languages.avisynth={comment:[{pattern:/(^|[^\\])\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|\[\*(?:[^\[*]|\[(?!\*)|\*(?!\]))*\*\])*\*\]/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\$])#.*/,lookbehind:!0,greedy:!0}],argument:{pattern:r(/\b(?:<<0>>)\s+("?)\w+\1/.source,[s],"i"),inside:{keyword:/^\w+/}},"argument-label":{pattern:/([,(][\s\\]*)\w+\s*=(?!=)/,lookbehind:!0,inside:{"argument-name":{pattern:/^\w+/,alias:"punctuation"},punctuation:/=$/}},string:[{pattern:/"""[\s\S]*?"""/,greedy:!0},{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0,inside:{constant:{pattern:/\b(?:DEFAULT_MT_MODE|(?:MAINSCRIPT|PROGRAM|SCRIPT)DIR|(?:MACHINE|USER)_(?:CLASSIC|PLUS)_PLUGINS)\b/}}}],variable:/\b(?:last)\b/i,boolean:/\b(?:false|no|true|yes)\b/i,keyword:/\b(?:catch|else|for|function|global|if|return|try|while|__END__)\b/i,constant:/\bMT_(?:MULTI_INSTANCE|NICE_FILTER|SERIALIZED|SPECIAL_MT)\b/,"builtin-function":{pattern:r(/\b(?:<<0>>)\b/.source,[u],"i"),alias:"function"},"type-cast":{pattern:r(/\b(?:<<0>>)(?=\s*\()/.source,[s],"i"),alias:"keyword"},function:{pattern:/\b[a-z_]\w*(?=\s*\()|(\.)[a-z_]\w*\b/i,lookbehind:!0},"line-continuation":{pattern:/(^[ \t]*)\\|\\(?=[ \t]*$)/m,lookbehind:!0,alias:"punctuation"},number:/\B\$(?:[\da-f]{6}|[\da-f]{8})\b|(?:(?:\b|\B-)\d+(?:\.\d*)?\b|\B\.\d+\b)/i,operator:/\+\+?|[!=<>]=?|&&|\|\||[?:*/%-]/,punctuation:/[{}\[\]();,.]/},t.languages.avs=t.languages.avisynth})(e)}qp.displayName="avro-idl";qp.aliases=["avdl"];function qp(e){e.languages["avro-idl"]={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,lookbehind:!0,greedy:!0},annotation:{pattern:/@(?:[$\w.-]|`[^\r\n`]+`)+/,greedy:!0,alias:"function"},"function-identifier":{pattern:/`[^\r\n`]+`(?=\s*\()/,greedy:!0,alias:"function"},identifier:{pattern:/`[^\r\n`]+`/,greedy:!0},"class-name":{pattern:/(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,lookbehind:!0,greedy:!0},keyword:/\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:[{pattern:/(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,lookbehind:!0},/-?\b(?:Infinity|NaN)\b/],operator:/=/,punctuation:/[()\[\]{}<>.:,;-]/},e.languages.avdl=e.languages["avro-idl"]}Vp.displayName="awk";Vp.aliases=["gawk"];function Vp(e){e.languages.awk={hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(^|[^\\])"(?:[^\\"\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},regex:{pattern:/((?:^|[^\w\s)])\s*)\/(?:[^\/\\\r\n]|\\.)*\//,lookbehind:!0,greedy:!0},variable:/\$\w+/,keyword:/\b(?:BEGIN|BEGINFILE|END|ENDFILE|break|case|continue|default|delete|do|else|exit|for|function|getline|if|in|next|nextfile|printf?|return|switch|while)\b|@(?:include|load)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[a-fA-F0-9]+)\b/,operator:/--|\+\+|!?~|>&|>>|<<|(?:\*\*|[<>!=+\-*/%^])=?|&&|\|[|&]|[?:]/,punctuation:/[()[\]{},;]/},e.languages.gawk=e.languages.awk}Yp.displayName="batch";Yp.aliases=[];function Yp(e){(function(t){var n=/%%?[~:\w]+%?|!\S+!/,r={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},s=/"(?:[\\"]"|[^"])*"(?!")/,i=/(?:\b|-)\d+\b/;t.languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0}],label:{pattern:/^:.*/m,alias:"property"},command:[{pattern:/((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im,lookbehind:!0,inside:{keyword:/\b(?:do|in)\b|^for\b/i,string:s,parameter:r,variable:n,number:i,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*)if(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|(?!")(?:(?!==)\S)+)?(?:==| (?:equ|geq|gtr|leq|lss|neq) )(?:"[^"]*"|[^\s"]\S*))/im,lookbehind:!0,inside:{keyword:/\b(?:cmdextversion|defined|errorlevel|exist|not)\b|^if\b/i,string:s,parameter:r,variable:n,number:i,operator:/\^|==|\b(?:equ|geq|gtr|leq|lss|neq)\b/i}},{pattern:/((?:^|[&()])[ \t]*)else\b/im,lookbehind:!0,inside:{keyword:/^else\b/i}},{pattern:/((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^set\b/i,string:s,parameter:r,variable:[n,/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],number:i,operator:/[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/m,lookbehind:!0,inside:{keyword:/^\w+\b/,string:s,parameter:r,label:{pattern:/(^\s*):\S+/m,lookbehind:!0,alias:"property"},variable:n,number:i,operator:/\^/}}],operator:/[&@]/,punctuation:/[()']/}})(e)}Kp.displayName="bbcode";Kp.aliases=["shortcode"];function Kp(e){e.languages.bbcode={tag:{pattern:/\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,inside:{tag:{pattern:/^\[\/?[^\s=\]]+/,inside:{punctuation:/^\[\/?/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\]/,"attr-name":/[^\s=\]]+/}}},e.languages.shortcode=e.languages.bbcode}Zp.displayName="bbj";Zp.aliases=[];function Zp(e){(function(t){t.languages.bbj={comment:{pattern:/(^|[^\\:])rem\s+.*/i,lookbehind:!0,greedy:!0},string:{pattern:/(['"])(?:(?!\1|\\).|\\.)*\1/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i,function:/\b\w+(?=\()/,boolean:/\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i,punctuation:/[.,;:()]/}})(e)}Xp.displayName="bicep";Xp.aliases=[];function Xp(e){e.languages.bicep={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],property:[{pattern:/([\r\n][ \t]*)[a-z_]\w*(?=[ \t]*:)/i,lookbehind:!0},{pattern:/([\r\n][ \t]*)'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'(?=[ \t]*:)/,lookbehind:!0,greedy:!0}],string:[{pattern:/'''[^'][\s\S]*?'''/,greedy:!0},{pattern:/(^|[^\\'])'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'/,lookbehind:!0,greedy:!0}],"interpolated-string":{pattern:/(^|[^\\'])'(?:\\.|\$(?:(?!\{)|\{[^{}\r\n]*\})|[^'\\\r\n$])*'/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/\$\{[^{}\r\n]*\}/,inside:{expression:{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0},punctuation:/^\$\{|\}$/}},string:/[\s\S]+/}},datatype:{pattern:/(\b(?:output|param)\b[ \t]+\w+[ \t]+)\w+\b/,lookbehind:!0,alias:"class-name"},boolean:/\b(?:false|true)\b/,keyword:/\b(?:existing|for|if|in|module|null|output|param|resource|targetScope|var)\b/,decorator:/@\w+\b/,function:/\b[a-z_]\w*(?=[ \t]*\()/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/,punctuation:/[{}[\];(),.:]/},e.languages.bicep["interpolated-string"].inside.interpolation.inside.expression.inside=e.languages.bicep}Qp.displayName="birb";Qp.aliases=[];function Qp(e){e.register(rt),e.languages.birb=e.languages.extend("clike",{string:{pattern:/r?("|')(?:\\.|(?!\1)[^\\])*\1/,greedy:!0},"class-name":[/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,/\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/],keyword:/\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|new|next|noSeeb|return|static|switch|throw|var|void|while)\b/,operator:/\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/,variable:/\b[a-z_]\w*\b/}),e.languages.insertBefore("birb","function",{metadata:{pattern:/<\w+>/,greedy:!0,alias:"symbol"}})}Jp.displayName="bison";Jp.aliases=[];function Jp(e){e.register(Yn),e.languages.bison=e.languages.extend("c",{}),e.languages.insertBefore("bison","comment",{bison:{pattern:/^(?:[^%]|%(?!%))*%%[\s\S]*?%%/,inside:{c:{pattern:/%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,inside:{delimiter:{pattern:/^%?\{|%?\}$/,alias:"punctuation"},"bison-variable":{pattern:/[$@](?:<[^\s>]+>)?[\w$]+/,alias:"variable",inside:{punctuation:/<|>/}},rest:e.languages.c}},comment:e.languages.c.comment,string:e.languages.c.string,property:/\S+(?=:)/,keyword:/%\w+/,number:{pattern:/(^|[^@])\b(?:0x[\da-f]+|\d+)/i,lookbehind:!0},punctuation:/%[%?]|[|:;\[\]<>]/}}})}ef.displayName="bnf";ef.aliases=["rbnf"];function ef(e){e.languages.bnf={string:{pattern:/"[^\r\n"]*"|'[^\r\n']*'/},definition:{pattern:/<[^<>\r\n\t]+>(?=\s*::=)/,alias:["rule","keyword"],inside:{punctuation:/^<|>$/}},rule:{pattern:/<[^<>\r\n\t]+>/,inside:{punctuation:/^<|>$/}},operator:/::=|[|()[\]{}*+?]|\.{3}/},e.languages.rbnf=e.languages.bnf}tf.displayName="bqn";tf.aliases=[];function tf(e){e.languages.bqn={shebang:{pattern:/^#![ \t]*\/.*/,alias:"important",greedy:!0},comment:{pattern:/#.*/,greedy:!0},"string-literal":{pattern:/"(?:[^"]|"")*"/,greedy:!0,alias:"string"},"character-literal":{pattern:/'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/,greedy:!0,alias:"char"},function:/•[\w¯.∞π]+[\w¯.∞π]*/,"dot-notation-on-brackets":{pattern:/\{(?=.*\}\.)|\}\./,alias:"namespace"},"special-name":{pattern:/(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/,alias:"keyword"},"dot-notation-on-name":{pattern:/[A-Za-z_][\w¯∞π]*\./,alias:"namespace"},"word-number-scientific":{pattern:/\d+(?:\.\d+)?[eE]¯?\d+/,alias:"number"},"word-name":{pattern:/[A-Za-z_][\w¯∞π]*/,alias:"symbol"},"word-number":{pattern:/[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/,alias:"number"},"null-literal":{pattern:/@/,alias:"char"},"primitive-functions":{pattern:/[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/,alias:"operator"},"primitive-1-operators":{pattern:/[`˜˘¨⁼⌜´˝˙]/,alias:"operator"},"primitive-2-operators":{pattern:/[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/,alias:"operator"},punctuation:/[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/}}nf.displayName="brainfuck";nf.aliases=[];function nf(e){e.languages.brainfuck={pointer:{pattern:/<|>/,alias:"keyword"},increment:{pattern:/\+/,alias:"inserted"},decrement:{pattern:/-/,alias:"deleted"},branching:{pattern:/\[|\]/,alias:"important"},operator:/[.,]/,comment:/\S+/}}rf.displayName="brightscript";rf.aliases=[];function rf(e){e.languages.brightscript={comment:/(?:\brem|').*/i,"directive-statement":{pattern:/(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im,lookbehind:!0,alias:"property",inside:{"error-message":{pattern:/(^#error).+/,lookbehind:!0},directive:{pattern:/^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/,alias:"keyword"},expression:{pattern:/[\s\S]+/,inside:null}}},property:{pattern:/([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},"class-name":{pattern:/(\bAs[\t ]+)\w+/i,lookbehind:!0},keyword:/\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i,boolean:/\b(?:false|true)\b/i,function:/\b(?!\d)\w+(?=[\t ]*\()/,number:/(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i,operator:/--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i,punctuation:/[.,;()[\]{}]/,constant:/\b(?:LINE_NUM)\b/i},e.languages.brightscript["directive-statement"].inside.expression.inside=e.languages.brightscript}sf.displayName="bro";sf.aliases=[];function sf(e){e.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(?:FIXME|TODO|XXX)\b/}},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},boolean:/\b[TF]\b/,function:{pattern:/(\b(?:event|function|hook)[ \t]+)\w+(?:::\w+)?/,lookbehind:!0},builtin:/(?:@(?:load(?:-(?:plugin|sigs))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:add_func|create_expire|default|delete_func|encrypt|error_handler|expire_func|group|log|mergeable|optional|persistent|priority|raw_output|read_expire|redef|rotate_interval|rotate_size|synchronized|type_column|write_expire))/,constant:{pattern:/(\bconst[ \t]+)\w+/i,lookbehind:!0},keyword:/\b(?:add|addr|alarm|any|bool|break|const|continue|count|delete|double|else|enum|event|export|file|for|function|global|hook|if|in|int|interval|local|module|next|of|opaque|pattern|port|print|record|return|schedule|set|string|subnet|table|time|timeout|using|vector|when)\b/,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,punctuation:/[{}[\];(),.:]/}}af.displayName="bsl";af.aliases=["oscript"];function af(e){e.languages.bsl={comment:/\/\/.*/,string:[{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},{pattern:/'(?:[^'\r\n\\]|\\.)*'/}],keyword:[{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:break|do|each|else|elseif|enddo|endfunction|endif|endprocedure|endtry|except|execute|export|false|for|function|if|in|new|null|procedure|raise|return|then|to|true|try|undefined|val|var|while)\b/i}],number:{pattern:/(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?/i,lookbehind:!0},operator:[/[<>+\-*/]=?|[%=]/,{pattern:/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,lookbehind:!0},{pattern:/\b(?:and|not|or)\b/i}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/,directive:[{pattern:/^([ \t]*)&.*/m,lookbehind:!0,greedy:!0,alias:"important"},{pattern:/^([ \t]*)#.*/gm,lookbehind:!0,greedy:!0,alias:"important"}]},e.languages.oscript=e.languages.bsl}of.displayName="cfscript";of.aliases=["cfc"];function of(e){e.register(rt),e.languages.cfscript=e.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,inside:{annotation:{pattern:/(?:^|[^.])@[\w\.]+/,alias:"punctuation"}}},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],keyword:/\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,operator:[/\+\+|--|&&|\|\||::|=>|[!=]==|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|:/,/\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/],scope:{pattern:/\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,alias:"global"},type:{pattern:/\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,alias:"builtin"}}),e.languages.insertBefore("cfscript","keyword",{"function-variable":{pattern:/[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"}}),delete e.languages.cfscript["class-name"],e.languages.cfc=e.languages.cfscript}lf.displayName="chaiscript";lf.aliases=[];function lf(e){e.register(rt),e.register(ps),e.languages.chaiscript=e.languages.extend("clike",{string:{pattern:/(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/,lookbehind:!0,greedy:!0},"class-name":[{pattern:/(\bclass\s+)\w+/,lookbehind:!0},{pattern:/(\b(?:attr|def)\s+)\w+(?=\s*::)/,lookbehind:!0}],keyword:/\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/,number:[e.languages.cpp.number,/\b(?:Infinity|NaN)\b/],operator:/>>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/}),e.languages.insertBefore("chaiscript","operator",{"parameter-type":{pattern:/([,(]\s*)\w+(?=\s+\w)/,lookbehind:!0,alias:"class-name"}}),e.languages.insertBefore("chaiscript","string",{"string-interpolation":{pattern:/(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,lookbehind:!0,inside:{"interpolation-expression":{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:e.languages.chaiscript},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"}}},string:/[\s\S]+/}}})}uf.displayName="cil";uf.aliases=[];function uf(e){e.languages.cil={comment:/\/\/.*/,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},directive:{pattern:/(^|\W)\.[a-z]+(?=\s)/,lookbehind:!0,alias:"class-name"},variable:/\[[\w\.]+\]/,keyword:/\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|u?int(?:8|16|32|64)?|iant|idispatch|implements|import|initonly|instance|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,function:/\b(?:(?:constrained|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.\d+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.\d+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/,boolean:/\b(?:false|true)\b/,number:/\b-?(?:0x[0-9a-f]+|\d+)(?:\.[0-9a-f]+)?\b/i,punctuation:/[{}[\];(),:=]|IL_[0-9A-Za-z]+/}}cf.displayName="cilkc";cf.aliases=["cilk-c"];function cf(e){e.register(Yn),e.languages.cilkc=e.languages.insertBefore("c","function",{"parallel-keyword":{pattern:/\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,alias:"keyword"}}),e.languages["cilk-c"]=e.languages.cilkc}df.displayName="cilkcpp";df.aliases=["cilk","cilk-cpp"];function df(e){e.register(ps),e.languages.cilkcpp=e.languages.insertBefore("cpp","function",{"parallel-keyword":{pattern:/\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,alias:"keyword"}}),e.languages["cilk-cpp"]=e.languages.cilkcpp,e.languages.cilk=e.languages.cilkcpp}pf.displayName="clojure";pf.aliases=[];function pf(e){e.languages.clojure={comment:{pattern:/;.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},char:/\\\w+/,symbol:{pattern:/(^|[\s()\[\]{},])::?[\w*+!?'<>=/.-]+/,lookbehind:!0},keyword:{pattern:/(\()(?:-|->|->>|\.|\.\.|\*|\/|\+|<|<=|=|==|>|>=|accessor|agent|agent-errors|aget|alength|all-ns|alter|and|append-child|apply|array-map|aset|aset-boolean|aset-byte|aset-char|aset-double|aset-float|aset-int|aset-long|aset-short|assert|assoc|await|await-for|bean|binding|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|boolean|branch\?|butlast|byte|cast|char|children|class|clear-agent-errors|comment|commute|comp|comparator|complement|concat|cond|conj|cons|constantly|construct-proxy|contains\?|count|create-ns|create-struct|cycle|dec|declare|def|def-|definline|definterface|defmacro|defmethod|defmulti|defn|defn-|defonce|defproject|defprotocol|defrecord|defstruct|deftype|deref|difference|disj|dissoc|distinct|do|doall|doc|dorun|doseq|dosync|dotimes|doto|double|down|drop|drop-while|edit|end\?|ensure|eval|every\?|false\?|ffirst|file-seq|filter|find|find-doc|find-ns|find-var|first|float|flush|fn|fnseq|for|frest|gensym|get|get-proxy-class|hash-map|hash-set|identical\?|identity|if|if-let|if-not|import|in-ns|inc|index|insert-child|insert-left|insert-right|inspect-table|inspect-tree|instance\?|int|interleave|intersection|into|into-array|iterate|join|key|keys|keyword|keyword\?|last|lazy-cat|lazy-cons|left|lefts|let|line-seq|list|list\*|load|load-file|locking|long|loop|macroexpand|macroexpand-1|make-array|make-node|map|map-invert|map\?|mapcat|max|max-key|memfn|merge|merge-with|meta|min|min-key|monitor-enter|name|namespace|neg\?|new|newline|next|nil\?|node|not|not-any\?|not-every\?|not=|ns|ns-imports|ns-interns|ns-map|ns-name|ns-publics|ns-refers|ns-resolve|ns-unmap|nth|nthrest|or|parse|partial|path|peek|pop|pos\?|pr|pr-str|print|print-str|println|println-str|prn|prn-str|project|proxy|proxy-mappings|quot|quote|rand|rand-int|range|re-find|re-groups|re-matcher|re-matches|re-pattern|re-seq|read|read-line|recur|reduce|ref|ref-set|refer|rem|remove|remove-method|remove-ns|rename|rename-keys|repeat|replace|replicate|resolve|rest|resultset-seq|reverse|rfirst|right|rights|root|rrest|rseq|second|select|select-keys|send|send-off|seq|seq-zip|seq\?|set|set!|short|slurp|some|sort|sort-by|sorted-map|sorted-map-by|sorted-set|special-symbol\?|split-at|split-with|str|string\?|struct|struct-map|subs|subvec|symbol|symbol\?|sync|take|take-nth|take-while|test|throw|time|to-array|to-array-2d|tree-seq|true\?|try|union|up|update-proxy|val|vals|var|var-get|var-set|var\?|vector|vector-zip|vector\?|when|when-first|when-let|when-not|with-local-vars|with-meta|with-open|with-out-str|xml-seq|xml-zip|zero\?|zipmap|zipper)(?=[\s)]|$)/,lookbehind:!0},boolean:/\b(?:false|nil|true)\b/,number:{pattern:/(^|[^\w$@])(?:\d+(?:[/.]\d+)?(?:e[+-]?\d+)?|0x[a-f0-9]+|[1-9]\d?r[a-z0-9]+)[lmn]?(?![\w$@])/i,lookbehind:!0},function:{pattern:/((?:^|[^'])\()[\w*+!?'<>=/.-]+(?=[\s)]|$)/,lookbehind:!0},operator:/[#@^`~]/,punctuation:/[{}\[\](),]/}}ff.displayName="cmake";ff.aliases=[];function ff(e){e.languages.cmake={comment:/#.*/,string:{pattern:/"(?:[^\\"]|\\.)*"/,greedy:!0,inside:{interpolation:{pattern:/\$\{(?:[^{}$]|\$\{[^{}$]*\})*\}/,inside:{punctuation:/\$\{|\}/,variable:/\w+/}}}},variable:/\b(?:CMAKE_\w+|\w+_(?:(?:BINARY|SOURCE)_DIR|DESCRIPTION|HOMEPAGE_URL|ROOT|VERSION(?:_MAJOR|_MINOR|_PATCH|_TWEAK)?)|(?:ANDROID|APPLE|BORLAND|BUILD_SHARED_LIBS|CACHE|CPACK_(?:ABSOLUTE_DESTINATION_FILES|COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY|ERROR_ON_ABSOLUTE_INSTALL_DESTINATION|INCLUDE_TOPLEVEL_DIRECTORY|INSTALL_DEFAULT_DIRECTORY_PERMISSIONS|INSTALL_SCRIPT|PACKAGING_INSTALL_PREFIX|SET_DESTDIR|WARN_ON_ABSOLUTE_INSTALL_DESTINATION)|CTEST_(?:BINARY_DIRECTORY|BUILD_COMMAND|BUILD_NAME|BZR_COMMAND|BZR_UPDATE_OPTIONS|CHANGE_ID|CHECKOUT_COMMAND|CONFIGURATION_TYPE|CONFIGURE_COMMAND|COVERAGE_COMMAND|COVERAGE_EXTRA_FLAGS|CURL_OPTIONS|CUSTOM_(?:COVERAGE_EXCLUDE|ERROR_EXCEPTION|ERROR_MATCH|ERROR_POST_CONTEXT|ERROR_PRE_CONTEXT|MAXIMUM_FAILED_TEST_OUTPUT_SIZE|MAXIMUM_NUMBER_OF_(?:ERRORS|WARNINGS)|MAXIMUM_PASSED_TEST_OUTPUT_SIZE|MEMCHECK_IGNORE|POST_MEMCHECK|POST_TEST|PRE_MEMCHECK|PRE_TEST|TESTS_IGNORE|WARNING_EXCEPTION|WARNING_MATCH)|CVS_CHECKOUT|CVS_COMMAND|CVS_UPDATE_OPTIONS|DROP_LOCATION|DROP_METHOD|DROP_SITE|DROP_SITE_CDASH|DROP_SITE_PASSWORD|DROP_SITE_USER|EXTRA_COVERAGE_GLOB|GIT_COMMAND|GIT_INIT_SUBMODULES|GIT_UPDATE_CUSTOM|GIT_UPDATE_OPTIONS|HG_COMMAND|HG_UPDATE_OPTIONS|LABELS_FOR_SUBPROJECTS|MEMORYCHECK_(?:COMMAND|COMMAND_OPTIONS|SANITIZER_OPTIONS|SUPPRESSIONS_FILE|TYPE)|NIGHTLY_START_TIME|P4_CLIENT|P4_COMMAND|P4_OPTIONS|P4_UPDATE_OPTIONS|RUN_CURRENT_SCRIPT|SCP_COMMAND|SITE|SOURCE_DIRECTORY|SUBMIT_URL|SVN_COMMAND|SVN_OPTIONS|SVN_UPDATE_OPTIONS|TEST_LOAD|TEST_TIMEOUT|TRIGGER_SITE|UPDATE_COMMAND|UPDATE_OPTIONS|UPDATE_VERSION_ONLY|USE_LAUNCHERS)|CYGWIN|ENV|EXECUTABLE_OUTPUT_PATH|GHS-MULTI|IOS|LIBRARY_OUTPUT_PATH|MINGW|MSVC(?:10|11|12|14|60|70|71|80|90|_IDE|_TOOLSET_VERSION|_VERSION)?|MSYS|PROJECT_NAME|UNIX|WIN32|WINCE|WINDOWS_PHONE|WINDOWS_STORE|XCODE))\b/,property:/\b(?:cxx_\w+|(?:ARCHIVE_OUTPUT_(?:DIRECTORY|NAME)|COMPILE_DEFINITIONS|COMPILE_PDB_NAME|COMPILE_PDB_OUTPUT_DIRECTORY|EXCLUDE_FROM_DEFAULT_BUILD|IMPORTED_(?:IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_LANGUAGES|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|NO_SONAME|OBJECTS|SONAME)|INTERPROCEDURAL_OPTIMIZATION|LIBRARY_OUTPUT_DIRECTORY|LIBRARY_OUTPUT_NAME|LINK_FLAGS|LINK_INTERFACE_LIBRARIES|LINK_INTERFACE_MULTIPLICITY|LOCATION|MAP_IMPORTED_CONFIG|OSX_ARCHITECTURES|OUTPUT_NAME|PDB_NAME|PDB_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_DIRECTORY|RUNTIME_OUTPUT_NAME|STATIC_LIBRARY_FLAGS|VS_CSHARP|VS_DOTNET_REFERENCEPROP|VS_DOTNET_REFERENCE|VS_GLOBAL_SECTION_POST|VS_GLOBAL_SECTION_PRE|VS_GLOBAL|XCODE_ATTRIBUTE)_\w+|\w+_(?:CLANG_TIDY|COMPILER_LAUNCHER|CPPCHECK|CPPLINT|INCLUDE_WHAT_YOU_USE|OUTPUT_NAME|POSTFIX|VISIBILITY_PRESET)|ABSTRACT|ADDITIONAL_MAKE_CLEAN_FILES|ADVANCED|ALIASED_TARGET|ALLOW_DUPLICATE_CUSTOM_TARGETS|ANDROID_(?:ANT_ADDITIONAL_OPTIONS|API|API_MIN|ARCH|ASSETS_DIRECTORIES|GUI|JAR_DEPENDENCIES|NATIVE_LIB_DEPENDENCIES|NATIVE_LIB_DIRECTORIES|PROCESS_MAX|PROGUARD|PROGUARD_CONFIG_PATH|SECURE_PROPS_PATH|SKIP_ANT_STEP|STL_TYPE)|ARCHIVE_OUTPUT_DIRECTORY|ATTACHED_FILES|ATTACHED_FILES_ON_FAIL|AUTOGEN_(?:BUILD_DIR|ORIGIN_DEPENDS|PARALLEL|SOURCE_GROUP|TARGETS_FOLDER|TARGET_DEPENDS)|AUTOMOC|AUTOMOC_(?:COMPILER_PREDEFINES|DEPEND_FILTERS|EXECUTABLE|MACRO_NAMES|MOC_OPTIONS|SOURCE_GROUP|TARGETS_FOLDER)|AUTORCC|AUTORCC_EXECUTABLE|AUTORCC_OPTIONS|AUTORCC_SOURCE_GROUP|AUTOUIC|AUTOUIC_EXECUTABLE|AUTOUIC_OPTIONS|AUTOUIC_SEARCH_PATHS|BINARY_DIR|BUILDSYSTEM_TARGETS|BUILD_RPATH|BUILD_RPATH_USE_ORIGIN|BUILD_WITH_INSTALL_NAME_DIR|BUILD_WITH_INSTALL_RPATH|BUNDLE|BUNDLE_EXTENSION|CACHE_VARIABLES|CLEAN_NO_CUSTOM|COMMON_LANGUAGE_RUNTIME|COMPATIBLE_INTERFACE_(?:BOOL|NUMBER_MAX|NUMBER_MIN|STRING)|COMPILE_(?:DEFINITIONS|FEATURES|FLAGS|OPTIONS|PDB_NAME|PDB_OUTPUT_DIRECTORY)|COST|CPACK_DESKTOP_SHORTCUTS|CPACK_NEVER_OVERWRITE|CPACK_PERMANENT|CPACK_STARTUP_SHORTCUTS|CPACK_START_MENU_SHORTCUTS|CPACK_WIX_ACL|CROSSCOMPILING_EMULATOR|CUDA_EXTENSIONS|CUDA_PTX_COMPILATION|CUDA_RESOLVE_DEVICE_SYMBOLS|CUDA_SEPARABLE_COMPILATION|CUDA_STANDARD|CUDA_STANDARD_REQUIRED|CXX_EXTENSIONS|CXX_STANDARD|CXX_STANDARD_REQUIRED|C_EXTENSIONS|C_STANDARD|C_STANDARD_REQUIRED|DEBUG_CONFIGURATIONS|DEFINE_SYMBOL|DEFINITIONS|DEPENDS|DEPLOYMENT_ADDITIONAL_FILES|DEPLOYMENT_REMOTE_DIRECTORY|DISABLED|DISABLED_FEATURES|ECLIPSE_EXTRA_CPROJECT_CONTENTS|ECLIPSE_EXTRA_NATURES|ENABLED_FEATURES|ENABLED_LANGUAGES|ENABLE_EXPORTS|ENVIRONMENT|EXCLUDE_FROM_ALL|EXCLUDE_FROM_DEFAULT_BUILD|EXPORT_NAME|EXPORT_PROPERTIES|EXTERNAL_OBJECT|EchoString|FAIL_REGULAR_EXPRESSION|FIND_LIBRARY_USE_LIB32_PATHS|FIND_LIBRARY_USE_LIB64_PATHS|FIND_LIBRARY_USE_LIBX32_PATHS|FIND_LIBRARY_USE_OPENBSD_VERSIONING|FIXTURES_CLEANUP|FIXTURES_REQUIRED|FIXTURES_SETUP|FOLDER|FRAMEWORK|Fortran_FORMAT|Fortran_MODULE_DIRECTORY|GENERATED|GENERATOR_FILE_NAME|GENERATOR_IS_MULTI_CONFIG|GHS_INTEGRITY_APP|GHS_NO_SOURCE_GROUP_FILE|GLOBAL_DEPENDS_DEBUG_MODE|GLOBAL_DEPENDS_NO_CYCLES|GNUtoMS|HAS_CXX|HEADER_FILE_ONLY|HELPSTRING|IMPLICIT_DEPENDS_INCLUDE_TRANSFORM|IMPORTED|IMPORTED_(?:COMMON_LANGUAGE_RUNTIME|CONFIGURATIONS|GLOBAL|IMPLIB|LIBNAME|LINK_DEPENDENT_LIBRARIES|LINK_INTERFACE_(?:LANGUAGES|LIBRARIES|MULTIPLICITY)|LOCATION|NO_SONAME|OBJECTS|SONAME)|IMPORT_PREFIX|IMPORT_SUFFIX|INCLUDE_DIRECTORIES|INCLUDE_REGULAR_EXPRESSION|INSTALL_NAME_DIR|INSTALL_RPATH|INSTALL_RPATH_USE_LINK_PATH|INTERFACE_(?:AUTOUIC_OPTIONS|COMPILE_DEFINITIONS|COMPILE_FEATURES|COMPILE_OPTIONS|INCLUDE_DIRECTORIES|LINK_DEPENDS|LINK_DIRECTORIES|LINK_LIBRARIES|LINK_OPTIONS|POSITION_INDEPENDENT_CODE|SOURCES|SYSTEM_INCLUDE_DIRECTORIES)|INTERPROCEDURAL_OPTIMIZATION|IN_TRY_COMPILE|IOS_INSTALL_COMBINED|JOB_POOLS|JOB_POOL_COMPILE|JOB_POOL_LINK|KEEP_EXTENSION|LABELS|LANGUAGE|LIBRARY_OUTPUT_DIRECTORY|LINKER_LANGUAGE|LINK_(?:DEPENDS|DEPENDS_NO_SHARED|DIRECTORIES|FLAGS|INTERFACE_LIBRARIES|INTERFACE_MULTIPLICITY|LIBRARIES|OPTIONS|SEARCH_END_STATIC|SEARCH_START_STATIC|WHAT_YOU_USE)|LISTFILE_STACK|LOCATION|MACOSX_BUNDLE|MACOSX_BUNDLE_INFO_PLIST|MACOSX_FRAMEWORK_INFO_PLIST|MACOSX_PACKAGE_LOCATION|MACOSX_RPATH|MACROS|MANUALLY_ADDED_DEPENDENCIES|MEASUREMENT|MODIFIED|NAME|NO_SONAME|NO_SYSTEM_FROM_IMPORTED|OBJECT_DEPENDS|OBJECT_OUTPUTS|OSX_ARCHITECTURES|OUTPUT_NAME|PACKAGES_FOUND|PACKAGES_NOT_FOUND|PARENT_DIRECTORY|PASS_REGULAR_EXPRESSION|PDB_NAME|PDB_OUTPUT_DIRECTORY|POSITION_INDEPENDENT_CODE|POST_INSTALL_SCRIPT|PREDEFINED_TARGETS_FOLDER|PREFIX|PRE_INSTALL_SCRIPT|PRIVATE_HEADER|PROCESSORS|PROCESSOR_AFFINITY|PROJECT_LABEL|PUBLIC_HEADER|REPORT_UNDEFINED_PROPERTIES|REQUIRED_FILES|RESOURCE|RESOURCE_LOCK|RULE_LAUNCH_COMPILE|RULE_LAUNCH_CUSTOM|RULE_LAUNCH_LINK|RULE_MESSAGES|RUNTIME_OUTPUT_DIRECTORY|RUN_SERIAL|SKIP_AUTOGEN|SKIP_AUTOMOC|SKIP_AUTORCC|SKIP_AUTOUIC|SKIP_BUILD_RPATH|SKIP_RETURN_CODE|SOURCES|SOURCE_DIR|SOVERSION|STATIC_LIBRARY_FLAGS|STATIC_LIBRARY_OPTIONS|STRINGS|SUBDIRECTORIES|SUFFIX|SYMBOLIC|TARGET_ARCHIVES_MAY_BE_SHARED_LIBS|TARGET_MESSAGES|TARGET_SUPPORTS_SHARED_LIBS|TESTS|TEST_INCLUDE_FILE|TEST_INCLUDE_FILES|TIMEOUT|TIMEOUT_AFTER_MATCH|TYPE|USE_FOLDERS|VALUE|VARIABLES|VERSION|VISIBILITY_INLINES_HIDDEN|VS_(?:CONFIGURATION_TYPE|COPY_TO_OUT_DIR|DEBUGGER_(?:COMMAND|COMMAND_ARGUMENTS|ENVIRONMENT|WORKING_DIRECTORY)|DEPLOYMENT_CONTENT|DEPLOYMENT_LOCATION|DOTNET_REFERENCES|DOTNET_REFERENCES_COPY_LOCAL|INCLUDE_IN_VSIX|IOT_STARTUP_TASK|KEYWORD|RESOURCE_GENERATOR|SCC_AUXPATH|SCC_LOCALPATH|SCC_PROJECTNAME|SCC_PROVIDER|SDK_REFERENCES|SHADER_(?:DISABLE_OPTIMIZATIONS|ENABLE_DEBUG|ENTRYPOINT|FLAGS|MODEL|OBJECT_FILE_NAME|OUTPUT_HEADER_FILE|TYPE|VARIABLE_NAME)|STARTUP_PROJECT|TOOL_OVERRIDE|USER_PROPS|WINRT_COMPONENT|WINRT_EXTENSIONS|WINRT_REFERENCES|XAML_TYPE)|WILL_FAIL|WIN32_EXECUTABLE|WINDOWS_EXPORT_ALL_SYMBOLS|WORKING_DIRECTORY|WRAP_EXCLUDE|XCODE_(?:EMIT_EFFECTIVE_PLATFORM_NAME|EXPLICIT_FILE_TYPE|FILE_ATTRIBUTES|LAST_KNOWN_FILE_TYPE|PRODUCT_TYPE|SCHEME_(?:ADDRESS_SANITIZER|ADDRESS_SANITIZER_USE_AFTER_RETURN|ARGUMENTS|DISABLE_MAIN_THREAD_CHECKER|DYNAMIC_LIBRARY_LOADS|DYNAMIC_LINKER_API_USAGE|ENVIRONMENT|EXECUTABLE|GUARD_MALLOC|MAIN_THREAD_CHECKER_STOP|MALLOC_GUARD_EDGES|MALLOC_SCRIBBLE|MALLOC_STACK|THREAD_SANITIZER(?:_STOP)?|UNDEFINED_BEHAVIOUR_SANITIZER(?:_STOP)?|ZOMBIE_OBJECTS))|XCTEST)\b/,keyword:/\b(?:add_compile_definitions|add_compile_options|add_custom_command|add_custom_target|add_definitions|add_dependencies|add_executable|add_library|add_link_options|add_subdirectory|add_test|aux_source_directory|break|build_command|build_name|cmake_host_system_information|cmake_minimum_required|cmake_parse_arguments|cmake_policy|configure_file|continue|create_test_sourcelist|ctest_build|ctest_configure|ctest_coverage|ctest_empty_binary_directory|ctest_memcheck|ctest_read_custom_files|ctest_run_script|ctest_sleep|ctest_start|ctest_submit|ctest_test|ctest_update|ctest_upload|define_property|else|elseif|enable_language|enable_testing|endforeach|endfunction|endif|endmacro|endwhile|exec_program|execute_process|export|export_library_dependencies|file|find_file|find_library|find_package|find_path|find_program|fltk_wrap_ui|foreach|function|get_cmake_property|get_directory_property|get_filename_component|get_property|get_source_file_property|get_target_property|get_test_property|if|include|include_directories|include_external_msproject|include_guard|include_regular_expression|install|install_files|install_programs|install_targets|link_directories|link_libraries|list|load_cache|load_command|macro|make_directory|mark_as_advanced|math|message|option|output_required_files|project|qt_wrap_cpp|qt_wrap_ui|remove|remove_definitions|return|separate_arguments|set|set_directory_properties|set_property|set_source_files_properties|set_target_properties|set_tests_properties|site_name|source_group|string|subdir_depends|subdirs|target_compile_definitions|target_compile_features|target_compile_options|target_include_directories|target_link_directories|target_link_libraries|target_link_options|target_sources|try_compile|try_run|unset|use_mangled_mesa|utility_source|variable_requires|variable_watch|while|write_file)(?=\s*\()\b/,boolean:/\b(?:FALSE|OFF|ON|TRUE)\b/,namespace:/\b(?:INTERFACE|PRIVATE|PROPERTIES|PUBLIC|SHARED|STATIC|TARGET_OBJECTS)\b/,operator:/\b(?:AND|DEFINED|EQUAL|GREATER|LESS|MATCHES|NOT|OR|STREQUAL|STRGREATER|STRLESS|VERSION_EQUAL|VERSION_GREATER|VERSION_LESS)\b/,inserted:{pattern:/\b\w+::\w+\b/,alias:"class-name"},number:/\b\d+(?:\.\d+)*\b/,function:/\b[a-z_]\w*(?=\s*\()\b/i,punctuation:/[()>}]|\$[<{]/}}mf.displayName="cobol";mf.aliases=[];function mf(e){e.languages.cobol={comment:{pattern:/\*>.*|(^[ \t]*)\*.*/m,lookbehind:!0,greedy:!0},string:{pattern:/[xzgn]?(?:"(?:[^\r\n"]|"")*"(?!")|'(?:[^\r\n']|'')*'(?!'))/i,greedy:!0},level:{pattern:/(^[ \t]*)\d+\b/m,lookbehind:!0,greedy:!0,alias:"number"},"class-name":{pattern:/(\bpic(?:ture)?\s+)(?:(?:[-\w$/,:*+<>]|\.(?!\s|$))(?:\(\d+\))?)+/i,lookbehind:!0,inside:{number:{pattern:/(\()\d+/,lookbehind:!0},punctuation:/[()]/}},keyword:{pattern:/(^|[^\w-])(?:ABORT|ACCEPT|ACCESS|ADD|ADDRESS|ADVANCING|AFTER|ALIGNED|ALL|ALPHABET|ALPHABETIC|ALPHABETIC-LOWER|ALPHABETIC-UPPER|ALPHANUMERIC|ALPHANUMERIC-EDITED|ALSO|ALTER|ALTERNATE|ANY|ARE|AREA|AREAS|AS|ASCENDING|ASCII|ASSIGN|ASSOCIATED-DATA|ASSOCIATED-DATA-LENGTH|AT|ATTRIBUTE|AUTHOR|AUTO|AUTO-SKIP|BACKGROUND-COLOR|BACKGROUND-COLOUR|BASIS|BEEP|BEFORE|BEGINNING|BELL|BINARY|BIT|BLANK|BLINK|BLOCK|BOTTOM|BOUNDS|BY|BYFUNCTION|BYTITLE|CALL|CANCEL|CAPABLE|CCSVERSION|CD|CF|CH|CHAINING|CHANGED|CHANNEL|CHARACTER|CHARACTERS|CLASS|CLASS-ID|CLOCK-UNITS|CLOSE|CLOSE-DISPOSITION|COBOL|CODE|CODE-SET|COL|COLLATING|COLUMN|COM-REG|COMMA|COMMITMENT|COMMON|COMMUNICATION|COMP|COMP-1|COMP-2|COMP-3|COMP-4|COMP-5|COMPUTATIONAL|COMPUTATIONAL-1|COMPUTATIONAL-2|COMPUTATIONAL-3|COMPUTATIONAL-4|COMPUTATIONAL-5|COMPUTE|CONFIGURATION|CONTAINS|CONTENT|CONTINUE|CONTROL|CONTROL-POINT|CONTROLS|CONVENTION|CONVERTING|COPY|CORR|CORRESPONDING|COUNT|CRUNCH|CURRENCY|CURSOR|DATA|DATA-BASE|DATE|DATE-COMPILED|DATE-WRITTEN|DAY|DAY-OF-WEEK|DBCS|DE|DEBUG-CONTENTS|DEBUG-ITEM|DEBUG-LINE|DEBUG-NAME|DEBUG-SUB-1|DEBUG-SUB-2|DEBUG-SUB-3|DEBUGGING|DECIMAL-POINT|DECLARATIVES|DEFAULT|DEFAULT-DISPLAY|DEFINITION|DELETE|DELIMITED|DELIMITER|DEPENDING|DESCENDING|DESTINATION|DETAIL|DFHRESP|DFHVALUE|DISABLE|DISK|DISPLAY|DISPLAY-1|DIVIDE|DIVISION|DONTCARE|DOUBLE|DOWN|DUPLICATES|DYNAMIC|EBCDIC|EGCS|EGI|ELSE|EMI|EMPTY-CHECK|ENABLE|END|END-ACCEPT|END-ADD|END-CALL|END-COMPUTE|END-DELETE|END-DIVIDE|END-EVALUATE|END-IF|END-MULTIPLY|END-OF-PAGE|END-PERFORM|END-READ|END-RECEIVE|END-RETURN|END-REWRITE|END-SEARCH|END-START|END-STRING|END-SUBTRACT|END-UNSTRING|END-WRITE|ENDING|ENTER|ENTRY|ENTRY-PROCEDURE|ENVIRONMENT|EOL|EOP|EOS|ERASE|ERROR|ESCAPE|ESI|EVALUATE|EVENT|EVERY|EXCEPTION|EXCLUSIVE|EXHIBIT|EXIT|EXPORT|EXTEND|EXTENDED|EXTERNAL|FD|FILE|FILE-CONTROL|FILLER|FINAL|FIRST|FOOTING|FOR|FOREGROUND-COLOR|FOREGROUND-COLOUR|FROM|FULL|FUNCTION|FUNCTION-POINTER|FUNCTIONNAME|GENERATE|GIVING|GLOBAL|GO|GOBACK|GRID|GROUP|HEADING|HIGH-VALUE|HIGH-VALUES|HIGHLIGHT|I-O|I-O-CONTROL|ID|IDENTIFICATION|IF|IMPLICIT|IMPORT|IN|INDEX|INDEXED|INDICATE|INITIAL|INITIALIZE|INITIATE|INPUT|INPUT-OUTPUT|INSPECT|INSTALLATION|INTEGER|INTO|INVALID|INVOKE|IS|JUST|JUSTIFIED|KANJI|KEPT|KEY|KEYBOARD|LABEL|LANGUAGE|LAST|LB|LD|LEADING|LEFT|LEFTLINE|LENGTH|LENGTH-CHECK|LIBACCESS|LIBPARAMETER|LIBRARY|LIMIT|LIMITS|LINAGE|LINAGE-COUNTER|LINE|LINE-COUNTER|LINES|LINKAGE|LIST|LOCAL|LOCAL-STORAGE|LOCK|LONG-DATE|LONG-TIME|LOW-VALUE|LOW-VALUES|LOWER|LOWLIGHT|MEMORY|MERGE|MESSAGE|MMDDYYYY|MODE|MODULES|MORE-LABELS|MOVE|MULTIPLE|MULTIPLY|NAMED|NATIONAL|NATIONAL-EDITED|NATIVE|NEGATIVE|NETWORK|NEXT|NO|NO-ECHO|NULL|NULLS|NUMBER|NUMERIC|NUMERIC-DATE|NUMERIC-EDITED|NUMERIC-TIME|OBJECT-COMPUTER|OCCURS|ODT|OF|OFF|OMITTED|ON|OPEN|OPTIONAL|ORDER|ORDERLY|ORGANIZATION|OTHER|OUTPUT|OVERFLOW|OVERLINE|OWN|PACKED-DECIMAL|PADDING|PAGE|PAGE-COUNTER|PASSWORD|PERFORM|PF|PH|PIC|PICTURE|PLUS|POINTER|PORT|POSITION|POSITIVE|PRINTER|PRINTING|PRIVATE|PROCEDURE|PROCEDURE-POINTER|PROCEDURES|PROCEED|PROCESS|PROGRAM|PROGRAM-ID|PROGRAM-LIBRARY|PROMPT|PURGE|QUEUE|QUOTE|QUOTES|RANDOM|RD|READ|READER|REAL|RECEIVE|RECEIVED|RECORD|RECORDING|RECORDS|RECURSIVE|REDEFINES|REEL|REF|REFERENCE|REFERENCES|RELATIVE|RELEASE|REMAINDER|REMARKS|REMOTE|REMOVAL|REMOVE|RENAMES|REPLACE|REPLACING|REPORT|REPORTING|REPORTS|REQUIRED|RERUN|RESERVE|RESET|RETURN|RETURN-CODE|RETURNING|REVERSE-VIDEO|REVERSED|REWIND|REWRITE|RF|RH|RIGHT|ROUNDED|RUN|SAME|SAVE|SCREEN|SD|SEARCH|SECTION|SECURE|SECURITY|SEGMENT|SEGMENT-LIMIT|SELECT|SEND|SENTENCE|SEPARATE|SEQUENCE|SEQUENTIAL|SET|SHARED|SHAREDBYALL|SHAREDBYRUNUNIT|SHARING|SHIFT-IN|SHIFT-OUT|SHORT-DATE|SIGN|SIZE|SORT|SORT-CONTROL|SORT-CORE-SIZE|SORT-FILE-SIZE|SORT-MERGE|SORT-MESSAGE|SORT-MODE-SIZE|SORT-RETURN|SOURCE|SOURCE-COMPUTER|SPACE|SPACES|SPECIAL-NAMES|STANDARD|STANDARD-1|STANDARD-2|START|STATUS|STOP|STRING|SUB-QUEUE-1|SUB-QUEUE-2|SUB-QUEUE-3|SUBTRACT|SUM|SUPPRESS|SYMBOL|SYMBOLIC|SYNC|SYNCHRONIZED|TABLE|TALLY|TALLYING|TAPE|TASK|TERMINAL|TERMINATE|TEST|TEXT|THEN|THREAD|THREAD-LOCAL|THROUGH|THRU|TIME|TIMER|TIMES|TITLE|TO|TODAYS-DATE|TODAYS-NAME|TOP|TRAILING|TRUNCATED|TYPE|TYPEDEF|UNDERLINE|UNIT|UNSTRING|UNTIL|UP|UPON|USAGE|USE|USING|VALUE|VALUES|VARYING|VIRTUAL|WAIT|WHEN|WHEN-COMPILED|WITH|WORDS|WORKING-STORAGE|WRITE|YEAR|YYYYDDD|YYYYMMDD|ZERO-FILL|ZEROES|ZEROS)(?![\w-])/i,lookbehind:!0},boolean:{pattern:/(^|[^\w-])(?:false|true)(?![\w-])/i,lookbehind:!0},number:{pattern:/(^|[^\w-])(?:[+-]?(?:(?:\d+(?:[.,]\d+)?|[.,]\d+)(?:e[+-]?\d+)?|zero))(?![\w-])/i,lookbehind:!0},operator:[/<>|[<>]=?|[=+*/&]/,{pattern:/(^|[^\w-])(?:-|and|equal|greater|less|not|or|than)(?![\w-])/i,lookbehind:!0}],punctuation:/[.:,()]/}}hf.displayName="coffeescript";hf.aliases=["coffee"];function hf(e){e.register(cn),(function(t){var n=/#(?!\{).+/,r={pattern:/#\{[^}]+\}/,alias:"variable"};t.languages.coffeescript=t.languages.extend("javascript",{comment:n,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:r}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),t.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:n,interpolation:r}}}),t.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:t.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:r}}]}),t.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete t.languages.coffeescript["template-string"],t.languages.coffee=t.languages.coffeescript})(e)}gf.displayName="concurnas";gf.aliases=["conc"];function gf(e){e.languages.concurnas={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,lookbehind:!0,greedy:!0},langext:{pattern:/\b\w+\s*\|\|[\s\S]+?\|\|/,greedy:!0,inside:{"class-name":/^\w+/,string:{pattern:/(^\s*\|\|)[\s\S]+(?=\|\|$)/,lookbehind:!0},punctuation:/\|\|/}},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,lookbehind:!0},keyword:/\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,boolean:/\b(?:false|true)\b/,number:/\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,punctuation:/[{}[\];(),.:]/,operator:/<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,annotation:{pattern:/@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,alias:"builtin"}},e.languages.insertBefore("concurnas","langext",{"regex-literal":{pattern:/\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:e.languages.concurnas},regex:/[\s\S]+/}},"string-literal":{pattern:/(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:e.languages.concurnas},string:/[\s\S]+/}}}),e.languages.conc=e.languages.concurnas}bf.displayName="csp";bf.aliases=[];function bf(e){(function(t){function n(r){return RegExp(/([ \t])/.source+"(?:"+r+")"+/(?=[\s;]|$)/.source,"i")}t.languages.csp={directive:{pattern:/(^|[\s;])(?:base-uri|block-all-mixed-content|(?:child|connect|default|font|frame|img|manifest|media|object|prefetch|script|style|worker)-src|disown-opener|form-action|frame-(?:ancestors|options)|input-protection(?:-(?:clip|selectors))?|navigate-to|plugin-types|policy-uri|referrer|reflected-xss|report-(?:to|uri)|require-sri-for|sandbox|(?:script|style)-src-(?:attr|elem)|upgrade-insecure-requests)(?=[\s;]|$)/i,lookbehind:!0,alias:"property"},scheme:{pattern:n(/[a-z][a-z0-9.+-]*:/.source),lookbehind:!0},none:{pattern:n(/'none'/.source),lookbehind:!0,alias:"keyword"},nonce:{pattern:n(/'nonce-[-+/\w=]+'/.source),lookbehind:!0,alias:"number"},hash:{pattern:n(/'sha(?:256|384|512)-[-+/\w=]+'/.source),lookbehind:!0,alias:"number"},host:{pattern:n(/[a-z][a-z0-9.+-]*:\/\/[^\s;,']*/.source+"|"+/\*[^\s;,']*/.source+"|"+/[a-z0-9-]+(?:\.[a-z0-9-]+)+(?::[\d*]+)?(?:\/[^\s;,']*)?/.source),lookbehind:!0,alias:"url",inside:{important:/\*/}},keyword:[{pattern:n(/'unsafe-[a-z-]+'/.source),lookbehind:!0,alias:"unsafe"},{pattern:n(/'[a-z-]+'/.source),lookbehind:!0,alias:"safe"}],punctuation:/;/}})(e)}xf.displayName="cooklang";xf.aliases=[];function xf(e){(function(t){var n=/(?:(?!\s)[\d$+<=a-zA-Z\x80-\uFFFF])+/.source,r=/[^{}@#]+/.source,s=/\{[^}#@]*\}/.source,i=r+s,o=/(?:h|hours|hrs|m|min|minutes)/.source,l={pattern:/\{[^{}]*\}/,inside:{amount:{pattern:/([\{|])[^{}|*%]+/,lookbehind:!0,alias:"number"},unit:{pattern:/(%)[^}]+/,lookbehind:!0,alias:"symbol"},"servings-scaler":{pattern:/\*/,alias:"operator"},"servings-alternative-separator":{pattern:/\|/,alias:"operator"},"unit-separator":{pattern:/(?:%|(\*)%)/,lookbehind:!0,alias:"operator"},punctuation:/[{}]/}};t.languages.cooklang={comment:{pattern:/\[-[\s\S]*?-\]|--.*/,greedy:!0},meta:{pattern:/>>.*:.*/,inside:{property:{pattern:/(>>\s*)[^\s:](?:[^:]*[^\s:])?/,lookbehind:!0}}},"cookware-group":{pattern:new RegExp("#(?:"+i+"|"+n+")"),inside:{cookware:{pattern:new RegExp("(^#)(?:"+r+")"),lookbehind:!0,alias:"variable"},"cookware-keyword":{pattern:/^#/,alias:"keyword"},"quantity-group":{pattern:new RegExp(/\{[^{}@#]*\}/),inside:{quantity:{pattern:new RegExp(/(^\{)/.source+r),lookbehind:!0,alias:"number"},punctuation:/[{}]/}}}},"ingredient-group":{pattern:new RegExp("@(?:"+i+"|"+n+")"),inside:{ingredient:{pattern:new RegExp("(^@)(?:"+r+")"),lookbehind:!0,alias:"variable"},"ingredient-keyword":{pattern:/^@/,alias:"keyword"},"amount-group":l}},"timer-group":{pattern:/~(?!\s)[^@#~{}]*\{[^{}]*\}/,inside:{timer:{pattern:/(^~)[^{]+/,lookbehind:!0,alias:"variable"},"duration-group":{pattern:/\{[^{}]*\}/,inside:{punctuation:/[{}]/,unit:{pattern:new RegExp(/(%\s*)/.source+o+/\b/.source),lookbehind:!0,alias:"symbol"},operator:/%/,duration:{pattern:/\d+/,alias:"number"}}},"timer-keyword":{pattern:/^~/,alias:"keyword"}}}}})(e)}yf.displayName="coq";yf.aliases=[];function yf(e){(function(t){for(var n=/\(\*(?:[^(*]|\((?!\*)|\*(?!\))|<self>)*\*\)/.source,r=0;r<2;r++)n=n.replace(/<self>/g,function(){return n});n=n.replace(/<self>/g,"[]"),t.languages.coq={comment:RegExp(n),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},attribute:[{pattern:RegExp(/#\[(?:[^\[\]("]|"(?:[^"]|"")*"(?!")|\((?!\*)|<comment>)*\]/.source.replace(/<comment>/g,function(){return n})),greedy:!0,alias:"attr-name",inside:{comment:RegExp(n),string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},operator:/=/,punctuation:/^#\[|\]$|[,()]/}},{pattern:/\b(?:Cumulative|Global|Local|Monomorphic|NonCumulative|Polymorphic|Private|Program)\b/,alias:"attr-name"}],keyword:/\b(?:Abort|About|Add|Admit|Admitted|All|Arguments|As|Assumptions|Axiom|Axioms|Back|BackTo|Backtrace|BinOp|BinOpSpec|BinRel|Bind|Blacklist|Canonical|Case|Cd|Check|Class|Classes|Close|CoFixpoint|CoInductive|Coercion|Coercions|Collection|Combined|Compute|Conjecture|Conjectures|Constant|Constants|Constraint|Constructors|Context|Corollary|Create|CstOp|Custom|Cut|Debug|Declare|Defined|Definition|Delimit|Dependencies|Dependent|Derive|Diffs|Drop|Elimination|End|Entry|Equality|Eval|Example|Existential|Existentials|Existing|Export|Extern|Extraction|Fact|Fail|Field|File|Firstorder|Fixpoint|Flags|Focus|From|Funclass|Function|Functional|GC|Generalizable|Goal|Grab|Grammar|Graph|Guarded|Haskell|Heap|Hide|Hint|HintDb|Hints|Hypotheses|Hypothesis|IF|Identity|Immediate|Implicit|Implicits|Import|Include|Induction|Inductive|Infix|Info|Initial|InjTyp|Inline|Inspect|Instance|Instances|Intro|Intros|Inversion|Inversion_clear|JSON|Language|Left|Lemma|Let|Lia|Libraries|Library|Load|LoadPath|Locate|Ltac|Ltac2|ML|Match|Method|Minimality|Module|Modules|Morphism|Next|NoInline|Notation|Number|OCaml|Obligation|Obligations|Opaque|Open|Optimize|Parameter|Parameters|Parametric|Path|Paths|Prenex|Preterm|Primitive|Print|Profile|Projections|Proof|Prop|PropBinOp|PropOp|PropUOp|Property|Proposition|Pwd|Qed|Quit|Rec|Record|Recursive|Redirect|Reduction|Register|Relation|Remark|Remove|Require|Reserved|Reset|Resolve|Restart|Rewrite|Right|Ring|Rings|SProp|Saturate|Save|Scheme|Scope|Scopes|Search|SearchHead|SearchPattern|SearchRewrite|Section|Separate|Set|Setoid|Show|Signatures|Solve|Solver|Sort|Sortclass|Sorted|Spec|Step|Strategies|Strategy|String|Structure|SubClass|Subgraph|SuchThat|Tactic|Term|TestCompile|Theorem|Time|Timeout|To|Transparent|Type|Typeclasses|Types|Typing|UnOp|UnOpSpec|Undelimit|Undo|Unfocus|Unfocused|Unfold|Universe|Universes|Unshelve|Variable|Variables|Variant|Verbose|View|Visibility|Zify|_|apply|as|at|by|cofix|else|end|exists|exists2|fix|for|forall|fun|if|in|let|match|measure|move|removed|return|struct|then|using|wf|where|with)\b/,number:/\b(?:0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]+)?(?:p[+-]?\d[\d_]*)?|\d[\d_]*(?:\.[\d_]+)?(?:e[+-]?\d[\d_]*)?)\b/i,punct:{pattern:/@\{|\{\||\[=|:>/,alias:"punctuation"},operator:/\/\\|\\\/|\.{2,3}|:{1,2}=|\*\*|[-=]>|<(?:->?|[+:=>]|<:)|>(?:=|->)|\|[-|]?|[-!%&*+/<=>?@^~']/,punctuation:/\.\(|`\(|@\{|`\{|\{\||\[=|:>|[:.,;(){}\[\]]/}})(e)}Ef.displayName="crystal";Ef.aliases=[];function Ef(e){e.register(gs),(function(t){t.languages.crystal=t.languages.extend("ruby",{keyword:[/\b(?:__DIR__|__END_LINE__|__FILE__|__LINE__|abstract|alias|annotation|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|ifdef|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|ptr|require|rescue|return|select|self|sizeof|struct|super|then|type|typeof|undef|uninitialized|union|unless|until|when|while|with|yield)\b/,{pattern:/(\.\s*)(?:is_a|responds_to)\?/,lookbehind:!0}],number:/\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/,operator:[/->/,t.languages.ruby.operator],punctuation:/[(){}[\].,;\\]/}),t.languages.insertBefore("crystal","string-literal",{attribute:{pattern:/@\[.*?\]/,inside:{delimiter:{pattern:/^@\[|\]$/,alias:"punctuation"},attribute:{pattern:/^(\s*)\w+/,lookbehind:!0,alias:"class-name"},args:{pattern:/\S(?:[\s\S]*\S)?/,inside:t.languages.crystal}}},expansion:{pattern:/\{(?:\{.*?\}|%.*?%)\}/,inside:{content:{pattern:/^(\{.)[\s\S]+(?=.\}$)/,lookbehind:!0,inside:t.languages.crystal},delimiter:{pattern:/^\{[\{%]|[\}%]\}$/,alias:"operator"}}},char:{pattern:/'(?:[^\\\r\n]{1,2}|\\(?:.|u(?:[A-Fa-f0-9]{1,4}|\{[A-Fa-f0-9]{1,6}\})))'/,greedy:!0}})})(e)}Sf.displayName="css-extras";Sf.aliases=[];function Sf(e){e.register(Hr),(function(t){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r;t.languages.css.selector={pattern:t.languages.css.selector.pattern,lookbehind:!0,inside:r={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp(`\\[(?:[^[\\]"']|`+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},t.languages.css.atrule.inside["selector-function-argument"].inside=r,t.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var s={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},i={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};t.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:s,number:i,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:s,number:i})})(e)}Tf.displayName="csv";Tf.aliases=[];function Tf(e){e.languages.csv={value:/[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,punctuation:/,/}}Nf.displayName="cue";Nf.aliases=[];function Nf(e){(function(t){var n=/\\(?:(?!\2)|\2(?:[^()\r\n]|\([^()]*\)))/.source,r=/"""(?:[^\\"]|"(?!""\2)|<esc>)*"""/.source+"|"+/'''(?:[^\\']|'(?!''\2)|<esc>)*'''/.source+"|"+/"(?:[^\\\r\n"]|"(?!\2)|<esc>)*"/.source+"|"+/'(?:[^\\\r\n']|'(?!\2)|<esc>)*'/.source,s="(?:"+r.replace(/<esc>/g,n)+")";t.languages.cue={comment:{pattern:/\/\/.*/,greedy:!0},"string-literal":{pattern:RegExp(/(^|[^#"'\\])(#*)/.source+s+/(?!["'])\2/.source),lookbehind:!0,greedy:!0,inside:{escape:{pattern:/(?=[\s\S]*["'](#*)$)\\\1(?:U[a-fA-F0-9]{1,8}|u[a-fA-F0-9]{1,4}|x[a-fA-F0-9]{1,2}|\d{2,3}|[^(])/,greedy:!0,alias:"string"},interpolation:{pattern:/(?=[\s\S]*["'](#*)$)\\\1\([^()]*\)/,greedy:!0,inside:{punctuation:/^\\#*\(|\)$/,expression:{pattern:/[\s\S]+/,inside:null}}},string:/[\s\S]+/}},keyword:{pattern:/(^|[^\w$])(?:for|if|import|in|let|null|package)(?![\w$])/,lookbehind:!0},boolean:{pattern:/(^|[^\w$])(?:false|true)(?![\w$])/,lookbehind:!0},builtin:{pattern:/(^|[^\w$])(?:bool|bytes|float|float(?:32|64)|u?int(?:8|16|32|64|128)?|number|rune|string)(?![\w$])/,lookbehind:!0},attribute:{pattern:/@[\w$]+(?=\s*\()/,alias:"function"},function:{pattern:/(^|[^\w$])[a-z_$][\w$]*(?=\s*\()/i,lookbehind:!0},number:{pattern:/(^|[^\w$.])(?:0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|0[xX][0-9A-Fa-f]+(?:_[0-9A-Fa-f]+)*|(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[eE][+-]?\d+(?:_\d+)*)?(?:[KMGTP]i?)?)(?![\w$])/,lookbehind:!0},operator:/\.{3}|_\|_|&&?|\|\|?|[=!]~|[<>=!]=?|[+\-*/?]/,punctuation:/[()[\]{},.:]/},t.languages.cue["string-literal"].inside.interpolation.inside.expression.inside=t.languages.cue})(e)}wf.displayName="cypher";wf.aliases=[];function wf(e){e.languages.cypher={comment:/\/\/.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/,greedy:!0},"class-name":{pattern:/(:\s*)(?:\w+|`(?:[^`\\\r\n])*`)(?=\s*[{):])/,lookbehind:!0,greedy:!0},relationship:{pattern:/(-\[\s*(?:\w+\s*|`(?:[^`\\\r\n])*`\s*)?:\s*|\|\s*:\s*)(?:\w+|`(?:[^`\\\r\n])*`)/,lookbehind:!0,greedy:!0,alias:"property"},identifier:{pattern:/`(?:[^`\\\r\n])*`/,greedy:!0},variable:/\$\w+/,keyword:/\b(?:ADD|ALL|AND|AS|ASC|ASCENDING|ASSERT|BY|CALL|CASE|COMMIT|CONSTRAINT|CONTAINS|CREATE|CSV|DELETE|DESC|DESCENDING|DETACH|DISTINCT|DO|DROP|ELSE|END|ENDS|EXISTS|FOR|FOREACH|IN|INDEX|IS|JOIN|KEY|LIMIT|LOAD|MANDATORY|MATCH|MERGE|NODE|NOT|OF|ON|OPTIONAL|OR|ORDER(?=\s+BY)|PERIODIC|REMOVE|REQUIRE|RETURN|SCALAR|SCAN|SET|SKIP|START|STARTS|THEN|UNION|UNIQUE|UNWIND|USING|WHEN|WHERE|WITH|XOR|YIELD)\b/i,function:/\b\w+\b(?=\s*\()/,boolean:/\b(?:false|null|true)\b/i,number:/\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?)\b/,operator:/:|<--?|--?>?|<>|=~?|[<>]=?|[+*/%^|]|\.\.\.?/,punctuation:/[()[\]{},;.]/}}vf.displayName="d";vf.aliases=[];function vf(e){e.register(rt),e.languages.d=e.languages.extend("clike",{comment:[{pattern:/^\s*#!.+/,greedy:!0},{pattern:RegExp(/(^|[^\\])/.source+"(?:"+[/\/\+(?:\/\+(?:[^+]|\+(?!\/))*\+\/|(?!\/\+)[\s\S])*?\+\//.source,/\/\/.*/.source,/\/\*[\s\S]*?\*\//.source].join("|")+")"),lookbehind:!0,greedy:!0}],string:[{pattern:RegExp([/\b[rx]"(?:\\[\s\S]|[^\\"])*"[cwd]?/.source,/\bq"(?:\[[\s\S]*?\]|\([\s\S]*?\)|<[\s\S]*?>|\{[\s\S]*?\})"/.source,/\bq"((?!\d)\w+)$[\s\S]*?^\1"/.source,/\bq"(.)[\s\S]*?\2"/.source,/(["`])(?:\\[\s\S]|(?!\3)[^\\])*\3[cwd]?/.source].join("|"),"m"),greedy:!0},{pattern:/\bq\{(?:\{[^{}]*\}|[^{}])*\}/,greedy:!0,alias:"token-string"}],keyword:/\$|\b(?:__(?:(?:DATE|EOF|FILE|FUNCTION|LINE|MODULE|PRETTY_FUNCTION|TIMESTAMP|TIME|VENDOR|VERSION)__|gshared|parameters|traits|vector)|abstract|alias|align|asm|assert|auto|body|bool|break|byte|case|cast|catch|cdouble|cent|cfloat|char|class|const|continue|creal|dchar|debug|default|delegate|delete|deprecated|do|double|dstring|else|enum|export|extern|false|final|finally|float|for|foreach|foreach_reverse|function|goto|idouble|if|ifloat|immutable|import|inout|int|interface|invariant|ireal|lazy|long|macro|mixin|module|new|nothrow|null|out|override|package|pragma|private|protected|ptrdiff_t|public|pure|real|ref|return|scope|shared|short|size_t|static|string|struct|super|switch|synchronized|template|this|throw|true|try|typedef|typeid|typeof|ubyte|ucent|uint|ulong|union|unittest|ushort|version|void|volatile|wchar|while|with|wstring)\b/,number:[/\b0x\.?[a-f\d_]+(?:(?!\.\.)\.[a-f\d_]*)?(?:p[+-]?[a-f\d_]+)?[ulfi]{0,4}/i,{pattern:/((?:\.\.)?)(?:\b0b\.?|\b|\.)\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:e[+-]?\d[\d_]*)?[ulfi]{0,4}/i,lookbehind:!0}],operator:/\|[|=]?|&[&=]?|\+[+=]?|-[-=]?|\.?\.\.|=[>=]?|!(?:i[ns]\b|<>?=?|>=?|=)?|\bi[ns]\b|(?:<[<>]?|>>?>?|\^\^|[*\/%^~])=?/}),e.languages.insertBefore("d","string",{char:/'(?:\\(?:\W|\w+)|[^\\])'/}),e.languages.insertBefore("d","keyword",{property:/\B@\w*/}),e.languages.insertBefore("d","function",{register:{pattern:/\b(?:[ABCD][LHX]|E?(?:BP|DI|SI|SP)|[BS]PL|[ECSDGF]S|CR[0234]|[DS]IL|DR[012367]|E[ABCD]X|X?MM[0-7]|R(?:1[0-5]|[89])[BWD]?|R[ABCD]X|R[BS]P|R[DS]I|TR[3-7]|XMM(?:1[0-5]|[89])|YMM(?:1[0-5]|\d))\b|\bST(?:\([0-7]\)|\b)/,alias:"variable"}})}Af.displayName="dart";Af.aliases=[];function Af(e){e.register(rt),(function(t){var n=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],r=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,s={pattern:RegExp(r+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};t.languages.dart=t.languages.extend("clike",{"class-name":[s,{pattern:RegExp(r+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:s.inside}],keyword:n,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),t.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:t.languages.dart}}},string:/[\s\S]+/}},string:void 0}),t.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),t.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":s,keyword:n,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(e)}kf.displayName="dataweave";kf.aliases=[];function kf(e){(function(t){t.languages.dataweave={url:/\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,property:{pattern:/(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/,greedy:!0},string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},"mime-type":/\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/,date:{pattern:/\|[\w:+-]+\|/,greedy:!0},comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],regex:{pattern:/\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,greedy:!0},keyword:/\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/,function:/\b[A-Z_]\w*(?=\s*\()/i,number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\];(),.:@]/,operator:/<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,boolean:/\b(?:false|true)\b/}})(e)}_f.displayName="dax";_f.aliases=[];function _f(e){e.languages.dax={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/).*)/,lookbehind:!0},"data-field":{pattern:/'(?:[^']|'')*'(?!')(?:\[[ \w\xA0-\uFFFF]+\])?|\w+\[[ \w\xA0-\uFFFF]+\]/,alias:"symbol"},measure:{pattern:/\[[ \w\xA0-\uFFFF]+\]/,alias:"constant"},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},function:/\b(?:ABS|ACOS|ACOSH|ACOT|ACOTH|ADDCOLUMNS|ADDMISSINGITEMS|ALL|ALLCROSSFILTERED|ALLEXCEPT|ALLNOBLANKROW|ALLSELECTED|AND|APPROXIMATEDISTINCTCOUNT|ASIN|ASINH|ATAN|ATANH|AVERAGE|AVERAGEA|AVERAGEX|BETA\.DIST|BETA\.INV|BLANK|CALCULATE|CALCULATETABLE|CALENDAR|CALENDARAUTO|CEILING|CHISQ\.DIST|CHISQ\.DIST\.RT|CHISQ\.INV|CHISQ\.INV\.RT|CLOSINGBALANCEMONTH|CLOSINGBALANCEQUARTER|CLOSINGBALANCEYEAR|COALESCE|COMBIN|COMBINA|COMBINEVALUES|CONCATENATE|CONCATENATEX|CONFIDENCE\.NORM|CONFIDENCE\.T|CONTAINS|CONTAINSROW|CONTAINSSTRING|CONTAINSSTRINGEXACT|CONVERT|COS|COSH|COT|COTH|COUNT|COUNTA|COUNTAX|COUNTBLANK|COUNTROWS|COUNTX|CROSSFILTER|CROSSJOIN|CURRENCY|CURRENTGROUP|CUSTOMDATA|DATATABLE|DATE|DATEADD|DATEDIFF|DATESBETWEEN|DATESINPERIOD|DATESMTD|DATESQTD|DATESYTD|DATEVALUE|DAY|DEGREES|DETAILROWS|DISTINCT|DISTINCTCOUNT|DISTINCTCOUNTNOBLANK|DIVIDE|EARLIER|EARLIEST|EDATE|ENDOFMONTH|ENDOFQUARTER|ENDOFYEAR|EOMONTH|ERROR|EVEN|EXACT|EXCEPT|EXP|EXPON\.DIST|FACT|FALSE|FILTER|FILTERS|FIND|FIRSTDATE|FIRSTNONBLANK|FIRSTNONBLANKVALUE|FIXED|FLOOR|FORMAT|GCD|GENERATE|GENERATEALL|GENERATESERIES|GEOMEAN|GEOMEANX|GROUPBY|HASONEFILTER|HASONEVALUE|HOUR|IF|IF\.EAGER|IFERROR|IGNORE|INT|INTERSECT|ISBLANK|ISCROSSFILTERED|ISEMPTY|ISERROR|ISEVEN|ISFILTERED|ISINSCOPE|ISLOGICAL|ISNONTEXT|ISNUMBER|ISO\.CEILING|ISODD|ISONORAFTER|ISSELECTEDMEASURE|ISSUBTOTAL|ISTEXT|KEEPFILTERS|KEYWORDMATCH|LASTDATE|LASTNONBLANK|LASTNONBLANKVALUE|LCM|LEFT|LEN|LN|LOG|LOG10|LOOKUPVALUE|LOWER|MAX|MAXA|MAXX|MEDIAN|MEDIANX|MID|MIN|MINA|MINUTE|MINX|MOD|MONTH|MROUND|NATURALINNERJOIN|NATURALLEFTOUTERJOIN|NEXTDAY|NEXTMONTH|NEXTQUARTER|NEXTYEAR|NONVISUAL|NORM\.DIST|NORM\.INV|NORM\.S\.DIST|NORM\.S\.INV|NOT|NOW|ODD|OPENINGBALANCEMONTH|OPENINGBALANCEQUARTER|OPENINGBALANCEYEAR|OR|PARALLELPERIOD|PATH|PATHCONTAINS|PATHITEM|PATHITEMREVERSE|PATHLENGTH|PERCENTILE\.EXC|PERCENTILE\.INC|PERCENTILEX\.EXC|PERCENTILEX\.INC|PERMUT|PI|POISSON\.DIST|POWER|PREVIOUSDAY|PREVIOUSMONTH|PREVIOUSQUARTER|PREVIOUSYEAR|PRODUCT|PRODUCTX|QUARTER|QUOTIENT|RADIANS|RAND|RANDBETWEEN|RANK\.EQ|RANKX|RELATED|RELATEDTABLE|REMOVEFILTERS|REPLACE|REPT|RIGHT|ROLLUP|ROLLUPADDISSUBTOTAL|ROLLUPGROUP|ROLLUPISSUBTOTAL|ROUND|ROUNDDOWN|ROUNDUP|ROW|SAMEPERIODLASTYEAR|SAMPLE|SEARCH|SECOND|SELECTCOLUMNS|SELECTEDMEASURE|SELECTEDMEASUREFORMATSTRING|SELECTEDMEASURENAME|SELECTEDVALUE|SIGN|SIN|SINH|SQRT|SQRTPI|STARTOFMONTH|STARTOFQUARTER|STARTOFYEAR|STDEV\.P|STDEV\.S|STDEVX\.P|STDEVX\.S|SUBSTITUTE|SUBSTITUTEWITHINDEX|SUM|SUMMARIZE|SUMMARIZECOLUMNS|SUMX|SWITCH|T\.DIST|T\.DIST\.2T|T\.DIST\.RT|T\.INV|T\.INV\.2T|TAN|TANH|TIME|TIMEVALUE|TODAY|TOPN|TOPNPERLEVEL|TOPNSKIP|TOTALMTD|TOTALQTD|TOTALYTD|TREATAS|TRIM|TRUE|TRUNC|UNICHAR|UNICODE|UNION|UPPER|USERELATIONSHIP|USERNAME|USEROBJECTID|USERPRINCIPALNAME|UTCNOW|UTCTODAY|VALUE|VALUES|VAR\.P|VAR\.S|VARX\.P|VARX\.S|WEEKDAY|WEEKNUM|XIRR|XNPV|YEAR|YEARFRAC)(?=\s*\()/i,keyword:/\b(?:DEFINE|EVALUATE|MEASURE|ORDER\s+BY|RETURN|VAR|START\s+AT|ASC|DESC)\b/i,boolean:{pattern:/\b(?:FALSE|NULL|TRUE)\b/i,alias:"constant"},number:/\b\d+(?:\.\d*)?|\B\.\d+\b/,operator:/:=|[-+*\/=^]|&&?|\|\||<(?:=>?|<|>)?|>[>=]?|\b(?:IN|NOT)\b/i,punctuation:/[;\[\](){}`,.]/}}Cf.displayName="dhall";Cf.aliases=[];function Cf(e){e.languages.dhall={comment:/--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,string:{pattern:/"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^{}]*\}/,inside:{expression:{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,alias:"language-dhall",inside:null},punctuation:/\$\{|\}/}}}},label:{pattern:/`[^`]*`/,greedy:!0},url:{pattern:/\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,greedy:!0},env:{pattern:/\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,greedy:!0,inside:{function:/^env/,operator:/^:/,variable:/[\s\S]+/}},hash:{pattern:/\bsha256:[\da-fA-F]{64}\b/,inside:{function:/sha256/,operator:/:/,number:/[\da-fA-F]{64}/}},keyword:/\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,builtin:/\b(?:None|Some)\b/,boolean:/\b(?:False|True)\b/,number:/\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,operator:/\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,punctuation:/\.\.|[{}\[\](),./]/,"class-name":/\b[A-Z]\w*\b/},e.languages.dhall.string.inside.interpolation.inside.expression.inside=e.languages.dhall}If.displayName="django";If.aliases=["jinja2"];function If(e){e.register(dn),(function(t){t.languages.django={comment:/^\{#[\s\S]*?#\}$/,tag:{pattern:/(^\{%[+-]?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%][+-]?|[+-]?[}%]\}$/,alias:"punctuation"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},filter:{pattern:/(\|)\w+/,lookbehind:!0,alias:"function"},test:{pattern:/(\bis\s+(?:not\s+)?)(?!not\b)\w+/,lookbehind:!0,alias:"function"},function:/\b[a-z_]\w+(?=\s*\()/i,keyword:/\b(?:and|as|by|else|for|if|import|in|is|loop|not|or|recursive|with|without)\b/,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,number:/\b\d+(?:\.\d+)?\b/,boolean:/[Ff]alse|[Nn]one|[Tt]rue/,variable:/\b\w+\b/,punctuation:/[{}[\](),.:;]/};var n=/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}|\{#[\s\S]*?#\}/g,r=t.languages["markup-templating"];t.hooks.add("before-tokenize",function(s){r.buildPlaceholders(s,"django",n)}),t.hooks.add("after-tokenize",function(s){r.tokenizePlaceholders(s,"django")}),t.languages.jinja2=t.languages.django,t.hooks.add("before-tokenize",function(s){r.buildPlaceholders(s,"jinja2",n)}),t.hooks.add("after-tokenize",function(s){r.tokenizePlaceholders(s,"jinja2")})})(e)}Rf.displayName="dns-zone-file";Rf.aliases=["dns-zone"];function Rf(e){e.languages["dns-zone-file"]={comment:/;.*/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},variable:[{pattern:/(^\$ORIGIN[ \t]+)\S+/m,lookbehind:!0},{pattern:/(^|\s)@(?=\s|$)/,lookbehind:!0}],keyword:/^\$(?:INCLUDE|ORIGIN|TTL)(?=\s|$)/m,class:{pattern:/(^|\s)(?:CH|CS|HS|IN)(?=\s|$)/,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|\s)(?:A|A6|AAAA|AFSDB|APL|ATMA|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|EID|GID|GPOS|HINFO|HIP|IPSECKEY|ISDN|KEY|KX|LOC|MAILA|MAILB|MB|MD|MF|MG|MINFO|MR|MX|NAPTR|NB|NBSTAT|NIMLOC|NINFO|NS|NSAP|NSAP-PTR|NSEC|NSEC3|NSEC3PARAM|NULL|NXT|OPENPGPKEY|PTR|PX|RKEY|RP|RRSIG|RT|SIG|SINK|SMIMEA|SOA|SPF|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT|UID|UINFO|UNSPEC|URI|WKS|X25)(?=\s|$)/,lookbehind:!0,alias:"keyword"},punctuation:/[()]/},e.languages["dns-zone"]=e.languages["dns-zone-file"]}Df.displayName="docker";Df.aliases=["dockerfile"];function Df(e){(function(t){var n=/\\[\r\n](?:\s|\\[\r\n]|#.*(?!.))*(?![\s#]|\\[\r\n])/.source,r=/(?:[ \t]+(?![ \t])(?:<SP_BS>)?|<SP_BS>)/.source.replace(/<SP_BS>/g,function(){return n}),s=/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"|'(?:[^'\\\r\n]|\\(?:\r\n|[\s\S]))*'/.source,i=/--[\w-]+=(?:<STR>|(?!["'])(?:[^\s\\]|\\.)+)/.source.replace(/<STR>/g,function(){return s}),o={pattern:RegExp(s),greedy:!0},l={pattern:/(^[ \t]*)#.*/m,lookbehind:!0,greedy:!0};function u(c,d){return c=c.replace(/<OPT>/g,function(){return i}).replace(/<SP>/g,function(){return r}),RegExp(c,d)}t.languages.docker={instruction:{pattern:/(^[ \t]*)(?:ADD|ARG|CMD|COPY|ENTRYPOINT|ENV|EXPOSE|FROM|HEALTHCHECK|LABEL|MAINTAINER|ONBUILD|RUN|SHELL|STOPSIGNAL|USER|VOLUME|WORKDIR)(?=\s)(?:\\.|[^\r\n\\])*(?:\\$(?:\s|#.*$)*(?![\s#])(?:\\.|[^\r\n\\])*)*/im,lookbehind:!0,greedy:!0,inside:{options:{pattern:u(/(^(?:ONBUILD<SP>)?\w+<SP>)<OPT>(?:<SP><OPT>)*/.source,"i"),lookbehind:!0,greedy:!0,inside:{property:{pattern:/(^|\s)--[\w-]+/,lookbehind:!0},string:[o,{pattern:/(=)(?!["'])(?:[^\s\\]|\\.)+/,lookbehind:!0}],operator:/\\$/m,punctuation:/=/}},keyword:[{pattern:u(/(^(?:ONBUILD<SP>)?HEALTHCHECK<SP>(?:<OPT><SP>)*)(?:CMD|NONE)\b/.source,"i"),lookbehind:!0,greedy:!0},{pattern:u(/(^(?:ONBUILD<SP>)?FROM<SP>(?:<OPT><SP>)*(?!--)[^ \t\\]+<SP>)AS/.source,"i"),lookbehind:!0,greedy:!0},{pattern:u(/(^ONBUILD<SP>)\w+/.source,"i"),lookbehind:!0,greedy:!0},{pattern:/^\w+/,greedy:!0}],comment:l,string:o,variable:/\$(?:\w+|\{[^{}"'\\]*\})/,operator:/\\$/m}},comment:l},t.languages.dockerfile=t.languages.docker})(e)}Of.displayName="dot";Of.aliases=["gv"];function Of(e){(function(t){var n="(?:"+[/[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source,/-?(?:\.\d+|\d+(?:\.\d*)?)/.source,/"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source,/<(?:[^<>]|(?!<!--)<(?:[^<>"']|"[^"]*"|'[^']*')+>|<!--(?:[^-]|-(?!->))*-->)*>/.source].join("|")+")",r={markup:{pattern:/(^<)[\s\S]+(?=>$)/,lookbehind:!0,alias:["language-markup","language-html","language-xml"],inside:t.languages.markup}};function s(i,o){return RegExp(i.replace(/<ID>/g,function(){return n}),o)}t.languages.dot={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,greedy:!0},"graph-name":{pattern:s(/(\b(?:digraph|graph|subgraph)[ \t\r\n]+)<ID>/.source,"i"),lookbehind:!0,greedy:!0,alias:"class-name",inside:r},"attr-value":{pattern:s(/(=[ \t\r\n]*)<ID>/.source),lookbehind:!0,greedy:!0,inside:r},"attr-name":{pattern:s(/([\[;, \t\r\n])<ID>(?=[ \t\r\n]*=)/.source),lookbehind:!0,greedy:!0,inside:r},keyword:/\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,"compass-point":{pattern:/(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/,lookbehind:!0,alias:"builtin"},node:{pattern:s(/(^|[^-.\w\x80-\uFFFF\\])<ID>/.source),lookbehind:!0,greedy:!0,inside:r},operator:/[=:]|-[->]/,punctuation:/[\[\]{};,]/},t.languages.gv=t.languages.dot})(e)}Lf.displayName="ebnf";Lf.aliases=[];function Lf(e){e.languages.ebnf={comment:/\(\*[\s\S]*?\*\)/,string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},special:{pattern:/\?[^?\r\n]*\?/,greedy:!0,alias:"class-name"},definition:{pattern:/^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,lookbehind:!0,alias:["rule","keyword"]},rule:/\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,punctuation:/\([:/]|[:/]\)|[.,;()[\]{}]/,operator:/[-=|*/!]/}}jf.displayName="editorconfig";jf.aliases=[];function jf(e){e.languages.editorconfig={comment:/[;#].*/,section:{pattern:/(^[ \t]*)\[.+\]/m,lookbehind:!0,alias:"selector",inside:{regex:/\\\\[\[\]{},!?.*]/,operator:/[!?]|\.\.|\*{1,2}/,punctuation:/[\[\]{},]/}},key:{pattern:/(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,lookbehind:!0,alias:"attr-name"},value:{pattern:/=.*/,alias:"attr-value",inside:{punctuation:/^=/}}}}Mf.displayName="eiffel";Mf.aliases=[];function Mf(e){e.languages.eiffel={comment:/--.*/,string:[{pattern:/"([^[]*)\[[\s\S]*?\]\1"/,greedy:!0},{pattern:/"([^{]*)\{[\s\S]*?\}\1"/,greedy:!0},{pattern:/"(?:%(?:(?!\n)\s)*\n\s*%|%\S|[^%"\r\n])*"/,greedy:!0}],char:/'(?:%.|[^%'\r\n])+'/,keyword:/\b(?:across|agent|alias|all|and|as|assign|attached|attribute|check|class|convert|create|Current|debug|deferred|detachable|do|else|elseif|end|ensure|expanded|export|external|feature|from|frozen|if|implies|inherit|inspect|invariant|like|local|loop|not|note|obsolete|old|once|or|Precursor|redefine|rename|require|rescue|Result|retry|select|separate|some|then|undefine|until|variant|Void|when|xor)\b/i,boolean:/\b(?:False|True)\b/i,"class-name":/\b[A-Z][\dA-Z_]*\b/,number:[/\b0[xcb][\da-f](?:_*[\da-f])*\b/i,/(?:\b\d(?:_*\d)*)?\.(?:(?:\d(?:_*\d)*)?e[+-]?)?\d(?:_*\d)*\b|\b\d(?:_*\d)*\b\.?/i],punctuation:/:=|<<|>>|\(\||\|\)|->|\.(?=\w)|[{}[\];(),:?]/,operator:/\\\\|\|\.\.\||\.\.|\/[~\/=]?|[><]=?|[-+*^=~]/}}Ff.displayName="ejs";Ff.aliases=["eta"];function Ff(e){e.register(cn),e.register(dn),(function(t){t.languages.ejs={delimiter:{pattern:/^<%[-_=]?|[-_]?%>$/,alias:"punctuation"},comment:/^#[\s\S]*/,"language-javascript":{pattern:/[\s\S]+/,inside:t.languages.javascript}},t.hooks.add("before-tokenize",function(n){var r=/<%(?!%)[\s\S]+?%>/g;t.languages["markup-templating"].buildPlaceholders(n,"ejs",r)}),t.hooks.add("after-tokenize",function(n){t.languages["markup-templating"].tokenizePlaceholders(n,"ejs")}),t.languages.eta=t.languages.ejs})(e)}Pf.displayName="elixir";Pf.aliases=[];function Pf(e){e.languages.elixir={doc:{pattern:/@(?:doc|moduledoc)\s+(?:("""|''')[\s\S]*?\1|("|')(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2)/,inside:{attribute:/^@\w+/,string:/['"][\s\S]+/}},comment:{pattern:/#.*/,greedy:!0},regex:{pattern:/~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/,greedy:!0},string:[{pattern:/~[cCsSwW](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|#\{[^}]+\}|#(?!\{)|[^#\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[csa]?/,greedy:!0,inside:{}},{pattern:/("""|''')[\s\S]*?\1/,greedy:!0,inside:{}},{pattern:/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{}}],atom:{pattern:/(^|[^:]):\w+/,lookbehind:!0,alias:"symbol"},module:{pattern:/\b[A-Z]\w*\b/,alias:"class-name"},"attr-name":/\b\w+\??:(?!:)/,argument:{pattern:/(^|[^&])&\d+/,lookbehind:!0,alias:"variable"},attribute:{pattern:/@\w+/,alias:"variable"},function:/\b[_a-zA-Z]\w*[?!]?(?:(?=\s*(?:\.\s*)?\()|(?=\/\d))/,number:/\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i,keyword:/\b(?:after|alias|and|case|catch|cond|def(?:callback|delegate|exception|impl|macro|module|n|np|p|protocol|struct)?|do|else|end|fn|for|if|import|not|or|quote|raise|require|rescue|try|unless|unquote|use|when)\b/,boolean:/\b(?:false|nil|true)\b/,operator:[/\bin\b|&&?|\|[|>]?|\\\\|::|\.\.\.?|\+\+?|-[->]?|<[-=>]|>=|!==?|\B!|=(?:==?|[>~])?|[*\/^]/,{pattern:/([^<])<(?!<)/,lookbehind:!0},{pattern:/([^>])>(?!>)/,lookbehind:!0}],punctuation:/<<|>>|[.,%\[\]{}()]/},e.languages.elixir.string.forEach(function(t){t.inside={interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},rest:e.languages.elixir}}}})}Bf.displayName="elm";Bf.aliases=[];function Bf(e){e.languages.elm={comment:/--.*|\{-[\s\S]*?-\}/,char:{pattern:/'(?:[^\\'\r\n]|\\(?:[abfnrtv\\']|\d+|x[0-9a-fA-F]+|u\{[0-9a-fA-F]+\}))'/,greedy:!0},string:[{pattern:/"""[\s\S]*?"""/,greedy:!0},{pattern:/"(?:[^\\"\r\n]|\\.)*"/,greedy:!0}],"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z]\w*(?:\.[A-Z]\w*)*(?:\s+as\s+(?:[A-Z]\w*)(?:\.[A-Z]\w*)*)?(?:\s+exposing\s+)?/m,lookbehind:!0,inside:{keyword:/\b(?:as|exposing|import)\b/}},keyword:/\b(?:alias|as|case|else|exposing|if|in|infixl|infixr|let|module|of|then|type)\b/,builtin:/\b(?:abs|acos|always|asin|atan|atan2|ceiling|clamp|compare|cos|curry|degrees|e|flip|floor|fromPolar|identity|isInfinite|isNaN|logBase|max|min|negate|never|not|pi|radians|rem|round|sin|sqrt|tan|toFloat|toPolar|toString|truncate|turns|uncurry|xor)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[0-9a-f]+)\b/i,operator:/\s\.\s|[+\-/*=.$<>:&|^?%#@~!]{2,}|[+\-/*=$<>:&|^?%#@~!]/,hvariable:/\b(?:[A-Z]\w*\.)*[a-z]\w*\b/,constant:/\b(?:[A-Z]\w*\.)*[A-Z]\w*\b/,punctuation:/[{}[\]|(),.:]/}}Uf.displayName="etlua";Uf.aliases=[];function Uf(e){e.register(zi),e.register(dn),(function(t){t.languages.etlua={delimiter:{pattern:/^<%[-=]?|-?%>$/,alias:"punctuation"},"language-lua":{pattern:/[\s\S]+/,inside:t.languages.lua}},t.hooks.add("before-tokenize",function(n){var r=/<%[\s\S]+?%>/g;t.languages["markup-templating"].buildPlaceholders(n,"etlua",r)}),t.hooks.add("after-tokenize",function(n){t.languages["markup-templating"].tokenizePlaceholders(n,"etlua")})})(e)}$f.displayName="erb";$f.aliases=[];function $f(e){e.register(dn),e.register(gs),(function(t){t.languages.erb={delimiter:{pattern:/^(\s*)<%=?|%>(?=\s*$)/,lookbehind:!0,alias:"punctuation"},ruby:{pattern:/\s*\S[\s\S]*/,alias:"language-ruby",inside:t.languages.ruby}},t.hooks.add("before-tokenize",function(n){var r=/<%=?(?:[^\r\n]|[\r\n](?!=begin)|[\r\n]=begin\s(?:[^\r\n]|[\r\n](?!=end))*[\r\n]=end)+?%>/g;t.languages["markup-templating"].buildPlaceholders(n,"erb",r)}),t.hooks.add("after-tokenize",function(n){t.languages["markup-templating"].tokenizePlaceholders(n,"erb")})})(e)}zf.displayName="erlang";zf.aliases=[];function zf(e){e.languages.erlang={comment:/%.+/,string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},"quoted-function":{pattern:/'(?:\\.|[^\\'\r\n])+'(?=\()/,alias:"function"},"quoted-atom":{pattern:/'(?:\\.|[^\\'\r\n])+'/,alias:"atom"},boolean:/\b(?:false|true)\b/,keyword:/\b(?:after|begin|case|catch|end|fun|if|of|receive|try|when)\b/,number:[/\$\\?./,/\b\d+#[a-z0-9]+/i,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i],function:/\b[a-z][\w@]*(?=\()/,variable:{pattern:/(^|[^@])(?:\b|\?)[A-Z_][\w@]*/,lookbehind:!0},operator:[/[=\/<>:]=|=[:\/]=|\+\+?|--?|[=*\/!]|\b(?:and|andalso|band|bnot|bor|bsl|bsr|bxor|div|not|or|orelse|rem|xor)\b/,{pattern:/(^|[^<])<(?!<)/,lookbehind:!0},{pattern:/(^|[^>])>(?!>)/,lookbehind:!0}],atom:/\b[a-z][\w@]*/,punctuation:/[()[\]{}:;,.#|]|<<|>>/}}Hf.displayName="excel-formula";Hf.aliases=["xls","xlsx"];function Hf(e){e.languages["excel-formula"]={comment:{pattern:/(\bN\(\s*)"(?:[^"]|"")*"(?=\s*\))/i,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},reference:{pattern:/(?:'[^']*'|(?:[^\s()[\]{}<>*?"';,$&]*\[[^^\s()[\]{}<>*?"']+\])?\w+)!/,greedy:!0,alias:"string",inside:{operator:/!$/,punctuation:/'/,sheet:{pattern:/[^[\]]+$/,alias:"function"},file:{pattern:/\[[^[\]]+\]$/,inside:{punctuation:/[[\]]/}},path:/[\s\S]+/}},"function-name":{pattern:/\b[A-Z]\w*(?=\()/i,alias:"builtin"},range:{pattern:/\$?\b(?:[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+|[A-Z]+:\$?[A-Z]+|\d+:\$?\d+)\b/i,alias:"selector",inside:{operator:/:/,cell:/\$?[A-Z]+\$?\d+/i,column:/\$?[A-Z]+/i,row:/\$?\d+/}},cell:{pattern:/\b[A-Z]+\d+\b|\$[A-Za-z]+\$?\d+\b|\b[A-Za-z]+\$\d+\b/,alias:"selector"},number:/(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?\b/i,boolean:/\b(?:FALSE|TRUE)\b/i,operator:/[-+*/^%=&,]|<[=>]?|>=?/,punctuation:/[[\]();{}|]/},e.languages.xlsx=e.languages.xls=e.languages["excel-formula"]}Gf.displayName="fsharp";Gf.aliases=[];function Gf(e){e.register(rt),e.languages.fsharp=e.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*(?!\))[\s\S]*?\*\)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(?:"""[\s\S]*?"""|@"(?:""|[^"])*"|"(?:\\[\s\S]|[^\\"])*")B?/,greedy:!0},"class-name":{pattern:/(\b(?:exception|inherit|interface|new|of|type)\s+|\w\s*:\s*|\s:\??>\s*)[.\w]+\b(?:\s*(?:->|\*)\s*[.\w]+\b)*(?!\s*[:.])/,lookbehind:!0,inside:{operator:/->|\*/,punctuation:/\./}},keyword:/\b(?:let|return|use|yield)(?:!\B|\b)|\b(?:abstract|and|as|asr|assert|atomic|base|begin|break|checked|class|component|const|constraint|constructor|continue|default|delegate|do|done|downcast|downto|eager|elif|else|end|event|exception|extern|external|false|finally|fixed|for|fun|function|functor|global|if|in|include|inherit|inline|interface|internal|land|lazy|lor|lsl|lsr|lxor|match|member|method|mixin|mod|module|mutable|namespace|new|not|null|object|of|open|or|override|parallel|private|process|protected|public|pure|rec|sealed|select|sig|static|struct|tailcall|then|to|trait|true|try|type|upcast|val|virtual|void|volatile|when|while|with)\b/,number:[/\b0x[\da-fA-F]+(?:LF|lf|un)?\b/,/\b0b[01]+(?:uy|y)?\b/,/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[fm]|e[+-]?\d+)?\b/i,/\b\d+(?:[IlLsy]|UL|u[lsy]?)?\b/],operator:/([<>~&^])\1\1|([*.:<>&])\2|<-|->|[!=:]=|<?\|{1,3}>?|\??(?:<=|>=|<>|[-+*/%=<>])\??|[!?^&]|~[+~-]|:>|:\?>?/}),e.languages.insertBefore("fsharp","keyword",{preprocessor:{pattern:/(^[\t ]*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(^#)\b(?:else|endif|if|light|line|nowarn)\b/,lookbehind:!0,alias:"keyword"}}}}),e.languages.insertBefore("fsharp","punctuation",{"computation-expression":{pattern:/\b[_a-z]\w*(?=\s*\{)/i,alias:"keyword"}}),e.languages.insertBefore("fsharp","string",{annotation:{pattern:/\[<.+?>\]/,greedy:!0,inside:{punctuation:/^\[<|>\]$/,"class-name":{pattern:/^\w+$|(^|;\s*)[A-Z]\w*(?=\()/,lookbehind:!0},"annotation-content":{pattern:/[\s\S]+/,inside:e.languages.fsharp}}},char:{pattern:/'(?:[^\\']|\\(?:.|\d{3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}|U[a-fA-F\d]{8}))'B?/,greedy:!0}})}Wf.displayName="factor";Wf.aliases=[];function Wf(e){(function(t){var n={function:/\b(?:BUGS?|FIX(?:MES?)?|NOTES?|TODOS?|XX+|HACKS?|WARN(?:ING)?|\?{2,}|!{2,})\b/},r={number:/\\[^\s']|%\w/},s={comment:[{pattern:/(^|\s)(?:! .*|!$)/,lookbehind:!0,inside:n},{pattern:/(^|\s)\/\*\s[\s\S]*?\*\/(?=\s|$)/,lookbehind:!0,greedy:!0,inside:n},{pattern:/(^|\s)!\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,inside:n}],number:[{pattern:/(^|\s)[+-]?\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b[01]+|o[0-7]+|d\d+|x[\dA-F]+)(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)[+-]?\d+\/\d+\.?(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)\+?\d+\+\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)-\d+-\d+\/\d+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?(?:\d*\.\d+|\d+\.\d*|\d+)(?:e[+-]?\d+)?(?=\s|$)/i,lookbehind:!0},{pattern:/(^|\s)NAN:\s+[\da-fA-F]+(?=\s|$)/,lookbehind:!0},{pattern:/(^|\s)[+-]?0(?:b1\.[01]*|o1\.[0-7]*|d1\.\d*|x1\.[\dA-F]*)p\d+(?=\s|$)/i,lookbehind:!0}],regexp:{pattern:/(^|\s)R\/\s(?:\\\S|[^\\/])*\/(?:[idmsr]*|[idmsr]+-[idmsr]+)(?=\s|$)/,lookbehind:!0,alias:"number",inside:{variable:/\\\S/,keyword:/[+?*\[\]^$(){}.|]/,operator:{pattern:/(\/)[idmsr]+(?:-[idmsr]+)?/,lookbehind:!0}}},boolean:{pattern:/(^|\s)[tf](?=\s|$)/,lookbehind:!0},"custom-string":{pattern:/(^|\s)[A-Z0-9\-]+"\s(?:\\\S|[^"\\])*"/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:/\\\S|%\w|\//}},"multiline-string":[{pattern:/(^|\s)STRING:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*;(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:{number:r.number,"semicolon-or-setlocal":{pattern:/([\r\n][ \t]*);(?=\s|$)/,lookbehind:!0,alias:"function"}}},{pattern:/(^|\s)HEREDOC:\s+\S+(?:\n|\r\n).*(?:\n|\r\n)\s*\S+(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:r},{pattern:/(^|\s)\[(={0,6})\[\s[\s\S]*?\]\2\](?=\s|$)/,lookbehind:!0,greedy:!0,alias:"string",inside:r}],"special-using":{pattern:/(^|\s)USING:(?:\s\S+)*(?=\s+;(?:\s|$))/,lookbehind:!0,alias:"function",inside:{string:{pattern:/(\s)[^:\s]+/,lookbehind:!0}}},"stack-effect-delimiter":[{pattern:/(^|\s)(?:call|eval|execute)?\((?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)--(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\)(?=\s|$)/,lookbehind:!0,alias:"operator"}],combinators:{pattern:null,lookbehind:!0,alias:"keyword"},"kernel-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"sequences-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"math-builtin":{pattern:null,lookbehind:!0,alias:"variable"},"constructor-word":{pattern:/(^|\s)<(?!=+>|-+>)\S+>(?=\s|$)/,lookbehind:!0,alias:"keyword"},"other-builtin-syntax":{pattern:null,lookbehind:!0,alias:"operator"},"conventionally-named-word":{pattern:/(^|\s)(?!")(?:(?:change|new|set|with)-\S+|\$\S+|>[^>\s]+|[^:>\s]+>|[^>\s]+>[^>\s]+|\+[^+\s]+\+|[^?\s]+\?|\?[^?\s]+|[^>\s]+>>|>>[^>\s]+|[^<\s]+<<|\([^()\s]+\)|[^!\s]+!|[^*\s]\S*\*|[^.\s]\S*\.)(?=\s|$)/,lookbehind:!0,alias:"keyword"},"colon-syntax":{pattern:/(^|\s)(?:[A-Z0-9\-]+#?)?:{1,2}\s+(?:;\S+|(?!;)\S+)(?=\s|$)/,lookbehind:!0,greedy:!0,alias:"function"},"semicolon-or-setlocal":{pattern:/(\s)(?:;|:>)(?=\s|$)/,lookbehind:!0,alias:"function"},"curly-brace-literal-delimiter":[{pattern:/(^|\s)[a-z]*\{(?=\s)/i,lookbehind:!0,alias:"operator"},{pattern:/(\s)\}(?=\s|$)/,lookbehind:!0,alias:"operator"}],"quotation-delimiter":[{pattern:/(^|\s)\[(?=\s)/,lookbehind:!0,alias:"operator"},{pattern:/(\s)\](?=\s|$)/,lookbehind:!0,alias:"operator"}],"normal-word":{pattern:/(^|\s)[^"\s]\S*(?=\s|$)/,lookbehind:!0},string:{pattern:/"(?:\\\S|[^"\\])*"/,greedy:!0,inside:r}},i=function(c){return(c+"").replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1")},o=function(c){return new RegExp("(^|\\s)(?:"+c.map(i).join("|")+")(?=\\s|$)")},l={"kernel-builtin":["or","2nipd","4drop","tuck","wrapper","nip","wrapper?","callstack>array","die","dupd","callstack","callstack?","3dup","hashcode","pick","4nip","build",">boolean","nipd","clone","5nip","eq?","?","=","swapd","2over","clear","2dup","get-retainstack","not","tuple?","dup","3nipd","call","-rotd","object","drop","assert=","assert?","-rot","execute","boa","get-callstack","curried?","3drop","pickd","overd","over","roll","3nip","swap","and","2nip","rotd","throw","(clone)","hashcode*","spin","reach","4dup","equal?","get-datastack","assert","2drop","<wrapper>","boolean?","identity-hashcode","identity-tuple?","null","composed?","new","5drop","rot","-roll","xor","identity-tuple","boolean"],"other-builtin-syntax":["=======","recursive","flushable",">>","<<<<<<","M\\","B","PRIVATE>","\\","======","final","inline","delimiter","deprecated","<PRIVATE",">>>>>>","<<<<<<<","parse-complex","malformed-complex","read-only",">>>>>>>","call-next-method","<<","foldable","$","$[","${"],"sequences-builtin":["member-eq?","mismatch","append","assert-sequence=","longer","repetition","clone-like","3sequence","assert-sequence?","last-index-from","reversed","index-from","cut*","pad-tail","join-as","remove-eq!","concat-as","but-last","snip","nths","nth","sequence","longest","slice?","<slice>","remove-nth","tail-slice","empty?","tail*","member?","virtual-sequence?","set-length","drop-prefix","iota","unclip","bounds-error?","unclip-last-slice","non-negative-integer-expected","non-negative-integer-expected?","midpoint@","longer?","?set-nth","?first","rest-slice","prepend-as","prepend","fourth","sift","subseq-start","new-sequence","?last","like","first4","1sequence","reverse","slice","virtual@","repetition?","set-last","index","4sequence","max-length","set-second","immutable-sequence","first2","first3","supremum","unclip-slice","suffix!","insert-nth","tail","3append","short","suffix","concat","flip","immutable?","reverse!","2sequence","sum","delete-all","indices","snip-slice","<iota>","check-slice","sequence?","head","append-as","halves","sequence=","collapse-slice","?second","slice-error?","product","bounds-check?","bounds-check","immutable","virtual-exemplar","harvest","remove","pad-head","last","set-fourth","cartesian-product","remove-eq","shorten","shorter","reversed?","shorter?","shortest","head-slice","pop*","tail-slice*","but-last-slice","iota?","append!","cut-slice","new-resizable","head-slice*","sequence-hashcode","pop","set-nth","?nth","second","join","immutable-sequence?","<reversed>","3append-as","virtual-sequence","subseq?","remove-nth!","length","last-index","lengthen","assert-sequence","copy","move","third","first","tail?","set-first","prefix","bounds-error","<repetition>","exchange","surround","cut","min-length","set-third","push-all","head?","subseq-start-from","delete-slice","rest","sum-lengths","head*","infimum","remove!","glue","slice-error","subseq","push","replace-slice","subseq-as","unclip-last"],"math-builtin":["number=","next-power-of-2","?1+","fp-special?","imaginary-part","float>bits","number?","fp-infinity?","bignum?","fp-snan?","denominator","gcd","*","+","fp-bitwise=","-","u>=","/",">=","bitand","power-of-2?","log2-expects-positive","neg?","<","log2",">","integer?","number","bits>double","2/","zero?","bits>float","float?","shift","ratio?","rect>","even?","ratio","fp-sign","bitnot",">fixnum","complex?","/i","integer>fixnum","/f","sgn",">bignum","next-float","u<","u>","mod","recip","rational",">float","2^","integer","fixnum?","neg","fixnum","sq","bignum",">rect","bit?","fp-qnan?","simple-gcd","complex","<fp-nan>","real",">fraction","double>bits","bitor","rem","fp-nan-payload","real-part","log2-expects-positive?","prev-float","align","unordered?","float","fp-nan?","abs","bitxor","integer>fixnum-strict","u<=","odd?","<=","/mod",">integer","real?","rational?","numerator"]};Object.keys(l).forEach(function(c){s[c].pattern=o(l[c])});var u=["2bi","while","2tri","bi*","4dip","both?","same?","tri@","curry","prepose","3bi","?if","tri*","2keep","3keep","curried","2keepd","when","2bi*","2tri*","4keep","bi@","keepdd","do","unless*","tri-curry","if*","loop","bi-curry*","when*","2bi@","2tri@","with","2with","either?","bi","until","3dip","3curry","tri-curry*","tri-curry@","bi-curry","keepd","compose","2dip","if","3tri","unless","tuple","keep","2curry","tri","most","while*","dip","composed","bi-curry@","find-last-from","trim-head-slice","map-as","each-from","none?","trim-tail","partition","if-empty","accumulate*","reject!","find-from","accumulate-as","collector-for-as","reject","map","map-sum","accumulate!","2each-from","follow","supremum-by","map!","unless-empty","collector","padding","reduce-index","replicate-as","infimum-by","trim-tail-slice","count","find-index","filter","accumulate*!","reject-as","map-integers","map-find","reduce","selector","interleave","2map","filter-as","binary-reduce","map-index-as","find","produce","filter!","replicate","cartesian-map","cartesian-each","find-index-from","map-find-last","3map-as","3map","find-last","selector-as","2map-as","2map-reduce","accumulate","each","each-index","accumulate*-as","when-empty","all?","collector-as","push-either","new-like","collector-for","2selector","push-if","2all?","map-reduce","3each","any?","trim-slice","2reduce","change-nth","produce-as","2each","trim","trim-head","cartesian-find","map-index","if-zero","each-integer","unless-zero","(find-integer)","when-zero","find-last-integer","(all-integers?)","times","(each-integer)","find-integer","all-integers?","unless-negative","if-positive","when-positive","when-negative","unless-positive","if-negative","case","2cleave","cond>quot","case>quot","3cleave","wrong-values","to-fixed-point","alist>quot","cond","cleave","call-effect","recursive-hashcode","spread","deep-spread>quot","2||","0||","n||","0&&","2&&","3||","1||","1&&","n&&","3&&","smart-unless*","keep-inputs","reduce-outputs","smart-when*","cleave>array","smart-with","smart-apply","smart-if","inputs/outputs","output>sequence-n","map-outputs","map-reduce-outputs","dropping","output>array","smart-map-reduce","smart-2map-reduce","output>array-n","nullary","input<sequence","append-outputs","drop-inputs","inputs","smart-2reduce","drop-outputs","smart-reduce","preserving","smart-when","outputs","append-outputs-as","smart-unless","smart-if*","sum-outputs","input<sequence-unsafe","output>sequence"];s.combinators.pattern=o(u),t.languages.factor=s})(e)}qf.displayName="false";qf.aliases=[];function qf(e){(function(t){t.languages.false={comment:{pattern:/\{[^}]*\}/},string:{pattern:/"[^"]*"/,greedy:!0},"character-code":{pattern:/'(?:[^\r]|\r\n?)/,alias:"number"},"assembler-code":{pattern:/\d+`/,alias:"important"},number:/\d+/,operator:/[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/,punctuation:/\[|\]/,variable:/[a-z]/,"non-standard":{pattern:/[()<BDO®]/,alias:"bold"}}})(e)}Vf.displayName="firestore-security-rules";Vf.aliases=[];function Vf(e){e.register(rt),e.languages["firestore-security-rules"]=e.languages.extend("clike",{comment:/\/\/.*/,keyword:/\b(?:allow|function|if|match|null|return|rules_version|service)\b/,operator:/&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/}),delete e.languages["firestore-security-rules"]["class-name"],e.languages.insertBefore("firestore-security-rules","keyword",{path:{pattern:/(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,inside:{operator:/=/,keyword:/\*\*/,punctuation:/[.$(){}]/}},punctuation:/\//}},method:{pattern:/(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,lookbehind:!0,alias:"builtin",inside:{punctuation:/,/}}})}Yf.displayName="flow";Yf.aliases=[];function Yf(e){e.register(cn),(function(t){t.languages.flow=t.languages.extend("javascript",{}),t.languages.insertBefore("flow","keyword",{type:[{pattern:/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,alias:"class-name"}]}),t.languages.flow["function-variable"].pattern=/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i,delete t.languages.flow.parameter,t.languages.insertBefore("flow","operator",{"flow-punctuation":{pattern:/\{\||\|\}/,alias:"punctuation"}}),Array.isArray(t.languages.flow.keyword)||(t.languages.flow.keyword=[t.languages.flow.keyword]),t.languages.flow.keyword.unshift({pattern:/(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,lookbehind:!0},{pattern:/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,lookbehind:!0})})(e)}Kf.displayName="fortran";Kf.aliases=[];function Kf(e){e.languages.fortran={"quoted-number":{pattern:/[BOZ](['"])[A-F0-9]+\1/i,alias:"number"},string:{pattern:/(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/,inside:{comment:{pattern:/(&(?:\r\n?|\n)\s*)!.*/,lookbehind:!0}}},comment:{pattern:/!.*/,greedy:!0},boolean:/\.(?:FALSE|TRUE)\.(?:_\w+)?/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,keyword:[/\b(?:CHARACTER|COMPLEX|DOUBLE ?PRECISION|INTEGER|LOGICAL|REAL)\b/i,/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEIF|ELSEWHERE|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i],operator:[/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i,{pattern:/(^|(?!\().)\/(?!\))/,lookbehind:!0}],punctuation:/\(\/|\/\)|[(),;:&]/}}Zf.displayName="ftl";Zf.aliases=[];function Zf(e){e.register(dn),(function(t){for(var n=/[^<()"']|\((?:<expr>)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/.source,r=0;r<2;r++)n=n.replace(/<expr>/g,function(){return n});n=n.replace(/<expr>/g,/[^\s\S]/.source);var s={comment:/<#--[\s\S]*?-->/,string:[{pattern:/\br("|')(?:(?!\1)[^\\]|\\.)*\1/,greedy:!0},{pattern:RegExp(/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:<expr>))*\})*\1/.source.replace(/<expr>/g,function(){return n})),greedy:!0,inside:{interpolation:{pattern:RegExp(/((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:<expr>))*\}/.source.replace(/<expr>/g,function(){return n})),lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:null}}}}],keyword:/\b(?:as)\b/,boolean:/\b(?:false|true)\b/,"builtin-function":{pattern:/((?:^|[^?])\?\s*)\w+/,lookbehind:!0,alias:"function"},function:/\b\w+(?=\s*\()/,number:/\b\d+(?:\.\d+)?\b/,operator:/\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,punctuation:/[,;.:()[\]{}]/};s.string[1].inside.interpolation.inside.rest=s,t.languages.ftl={"ftl-comment":{pattern:/^<#--[\s\S]*/,alias:"comment"},"ftl-directive":{pattern:/^<[\s\S]+>$/,inside:{directive:{pattern:/(^<\/?)[#@][a-z]\w*/i,lookbehind:!0,alias:"keyword"},punctuation:/^<\/?|\/?>$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:s}}},"ftl-interpolation":{pattern:/^\$\{[\s\S]*\}$/,inside:{punctuation:/^\$\{|\}$/,content:{pattern:/\s*\S[\s\S]*/,alias:"ftl",inside:s}}}},t.hooks.add("before-tokenize",function(i){var o=RegExp(/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:<expr>)*?>|\$\{(?:<expr>)*?\}/.source.replace(/<expr>/g,function(){return n}),"gi");t.languages["markup-templating"].buildPlaceholders(i,"ftl",o)}),t.hooks.add("after-tokenize",function(i){t.languages["markup-templating"].tokenizePlaceholders(i,"ftl")})})(e)}Xf.displayName="gml";Xf.aliases=["gamemakerlanguage"];function Xf(e){e.register(rt),e.languages.gamemakerlanguage=e.languages.gml=e.languages.extend("clike",{keyword:/\b(?:break|case|continue|default|do|else|enum|exit|for|globalvar|if|repeat|return|switch|until|var|while)\b/,number:/(?:\b0x[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ulf]{0,4}/i,operator:/--|\+\+|[-+%/=]=?|!=|\*\*?=?|<[<=>]?|>[=>]?|&&?|\^\^?|\|\|?|~|\b(?:and|at|not|or|with|xor)\b/,constant:/\b(?:GM_build_date|GM_version|action_(?:continue|restart|reverse|stop)|all|gamespeed_(?:fps|microseconds)|global|local|noone|other|pi|pointer_(?:invalid|null)|self|timezone_(?:local|utc)|undefined|ev_(?:create|destroy|step|alarm|keyboard|mouse|collision|other|draw|draw_(?:begin|end|post|pre)|keypress|keyrelease|trigger|(?:left|middle|no|right)_button|(?:left|middle|right)_press|(?:left|middle|right)_release|mouse_(?:enter|leave|wheel_down|wheel_up)|global_(?:left|middle|right)_button|global_(?:left|middle|right)_press|global_(?:left|middle|right)_release|joystick(?:1|2)_(?:button1|button2|button3|button4|button5|button6|button7|button8|down|left|right|up)|outside|boundary|game_start|game_end|room_start|room_end|no_more_lives|animation_end|end_of_path|no_more_health|user\d|gui|gui_begin|gui_end|step_(?:begin|end|normal))|vk_(?:alt|anykey|backspace|control|delete|down|end|enter|escape|home|insert|left|nokey|pagedown|pageup|pause|printscreen|return|right|shift|space|tab|up|f\d|numpad\d|add|decimal|divide|lalt|lcontrol|lshift|multiply|ralt|rcontrol|rshift|subtract)|achievement_(?:filter_(?:all_players|favorites_only|friends_only)|friends_info|info|leaderboard_info|our_info|pic_loaded|show_(?:achievement|bank|friend_picker|leaderboard|profile|purchase_prompt|ui)|type_challenge|type_score_challenge)|asset_(?:font|object|path|room|script|shader|sound|sprite|tiles|timeline|unknown)|audio_(?:3d|falloff_(?:exponent_distance|exponent_distance_clamped|inverse_distance|inverse_distance_clamped|linear_distance|linear_distance_clamped|none)|mono|new_system|old_system|stereo)|bm_(?:add|complex|dest_alpha|dest_color|dest_colour|inv_dest_alpha|inv_dest_color|inv_dest_colour|inv_src_alpha|inv_src_color|inv_src_colour|max|normal|one|src_alpha|src_alpha_sat|src_color|src_colour|subtract|zero)|browser_(?:chrome|firefox|ie|ie_mobile|not_a_browser|opera|safari|safari_mobile|tizen|unknown|windows_store)|buffer_(?:bool|f16|f32|f64|fast|fixed|generalerror|grow|invalidtype|network|outofbounds|outofspace|s16|s32|s8|seek_end|seek_relative|seek_start|string|text|u16|u32|u64|u8|vbuffer|wrap)|c_(?:aqua|black|blue|dkgray|fuchsia|gray|green|lime|ltgray|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)|cmpfunc_(?:always|equal|greater|greaterequal|less|lessequal|never|notequal)|cr_(?:appstart|arrow|beam|cross|default|drag|handpoint|hourglass|none|size_all|size_nesw|size_ns|size_nwse|size_we|uparrow)|cull_(?:clockwise|counterclockwise|noculling)|device_(?:emulator|tablet)|device_ios_(?:ipad|ipad_retina|iphone|iphone5|iphone6|iphone6plus|iphone_retina|unknown)|display_(?:landscape|landscape_flipped|portrait|portrait_flipped)|dll_(?:cdecl|cdel|stdcall)|ds_type_(?:grid|list|map|priority|queue|stack)|ef_(?:cloud|ellipse|explosion|firework|flare|rain|ring|smoke|smokeup|snow|spark|star)|fa_(?:archive|bottom|center|directory|hidden|left|middle|readonly|right|sysfile|top|volumeid)|fb_login_(?:default|fallback_to_webview|forcing_safari|forcing_webview|no_fallback_to_webview|use_system_account)|iap_(?:available|canceled|ev_consume|ev_product|ev_purchase|ev_restore|ev_storeload|failed|purchased|refunded|status_available|status_loading|status_processing|status_restoring|status_unavailable|status_uninitialised|storeload_failed|storeload_ok|unavailable)|leaderboard_type_(?:number|time_mins_secs)|lighttype_(?:dir|point)|matrix_(?:projection|view|world)|mb_(?:any|left|middle|none|right)|network_(?:config_(?:connect_timeout|disable_reliable_udp|enable_reliable_udp|use_non_blocking_socket)|socket_(?:bluetooth|tcp|udp)|type_(?:connect|data|disconnect|non_blocking_connect))|of_challenge_(?:lose|tie|win)|os_(?:android|ios|linux|macosx|ps3|ps4|psvita|unknown|uwp|win32|win8native|windows|winphone|xboxone)|phy_debug_render_(?:aabb|collision_pairs|coms|core_shapes|joints|obb|shapes)|phy_joint_(?:anchor_1_x|anchor_1_y|anchor_2_x|anchor_2_y|angle|angle_limits|damping_ratio|frequency|length_1|length_2|lower_angle_limit|max_force|max_length|max_motor_force|max_motor_torque|max_torque|motor_force|motor_speed|motor_torque|reaction_force_x|reaction_force_y|reaction_torque|speed|translation|upper_angle_limit)|phy_particle_data_flag_(?:category|color|colour|position|typeflags|velocity)|phy_particle_flag_(?:colormixing|colourmixing|elastic|powder|spring|tensile|viscous|wall|water|zombie)|phy_particle_group_flag_(?:rigid|solid)|pr_(?:linelist|linestrip|pointlist|trianglefan|trianglelist|trianglestrip)|ps_(?:distr|shape)_(?:diamond|ellipse|gaussian|invgaussian|line|linear|rectangle)|pt_shape_(?:circle|cloud|disk|explosion|flare|line|pixel|ring|smoke|snow|spark|sphere|square|star)|ty_(?:real|string)|gp_(?:face\d|axislh|axislv|axisrh|axisrv|padd|padl|padr|padu|select|shoulderl|shoulderlb|shoulderr|shoulderrb|start|stickl|stickr)|lb_disp_(?:none|numeric|time_ms|time_sec)|lb_sort_(?:ascending|descending|none)|ov_(?:achievements|community|friends|gamegroup|players|settings)|ugc_(?:filetype_(?:community|microtrans)|list_(?:Favorited|Followed|Published|Subscribed|UsedOrPlayed|VotedDown|VotedOn|VotedUp|WillVoteLater)|match_(?:AllGuides|Artwork|Collections|ControllerBindings|IntegratedGuides|Items|Items_Mtx|Items_ReadyToUse|Screenshots|UsableInGame|Videos|WebGuides)|query_(?:AcceptedForGameRankedByAcceptanceDate|CreatedByFriendsRankedByPublicationDate|FavoritedByFriendsRankedByPublicationDate|NotYetRated)|query_RankedBy(?:NumTimesReported|PublicationDate|TextSearch|TotalVotesAsc|Trend|Vote|VotesUp)|result_success|sortorder_CreationOrder(?:Asc|Desc)|sortorder_(?:ForModeration|LastUpdatedDesc|SubscriptionDateDesc|TitleAsc|VoteScoreDesc)|visibility_(?:friends_only|private|public))|vertex_usage_(?:binormal|blendindices|blendweight|color|colour|depth|fog|normal|position|psize|sample|tangent|texcoord|textcoord)|vertex_type_(?:float\d|color|colour|ubyte4)|input_type|layerelementtype_(?:background|instance|oldtilemap|particlesystem|sprite|tile|tilemap|undefined)|se_(?:chorus|compressor|echo|equalizer|flanger|gargle|none|reverb)|text_type|tile_(?:flip|index_mask|mirror|rotate)|(?:obj|rm|scr|spr)\w+)\b/,variable:/\b(?:alarm|application_surface|async_load|background_(?:alpha|blend|color|colour|foreground|height|hspeed|htiled|index|showcolor|showcolour|visible|vspeed|vtiled|width|x|xscale|y|yscale)|bbox_(?:bottom|left|right|top)|browser_(?:height|width)|caption_(?:health|lives|score)|current_(?:day|hour|minute|month|second|time|weekday|year)|cursor_sprite|debug_mode|delta_time|direction|display_aa|error_(?:last|occurred)|event_(?:action|number|object|type)|fps|fps_real|friction|game_(?:display|project|save)_(?:id|name)|gamemaker_(?:pro|registered|version)|gravity|gravity_direction|(?:h|v)speed|health|iap_data|id|image_(?:alpha|angle|blend|depth|index|number|speed|xscale|yscale)|instance_(?:count|id)|keyboard_(?:key|lastchar|lastkey|string)|layer|lives|mask_index|mouse_(?:button|lastbutton|x|y)|object_index|os_(?:browser|device|type|version)|path_(?:endaction|index|orientation|position|positionprevious|scale|speed)|persistent|phy_(?:rotation|(?:col_normal|collision|com|linear_velocity|position|speed)_(?:x|y)|angular_(?:damping|velocity)|position_(?:x|y)previous|speed|linear_damping|bullet|fixed_rotation|active|mass|inertia|dynamic|kinematic|sleeping|collision_points)|pointer_(?:invalid|null)|room|room_(?:caption|first|height|last|persistent|speed|width)|score|secure_mode|show_(?:health|lives|score)|solid|speed|sprite_(?:height|index|width|xoffset|yoffset)|temp_directory|timeline_(?:index|loop|position|running|speed)|transition_(?:color|kind|steps)|undefined|view_(?:angle|current|enabled|(?:h|v)(?:border|speed)|(?:h|w|x|y)port|(?:h|w|x|y)view|object|surface_id|visible)|visible|webgl_enabled|working_directory|(?:x|y)(?:previous|start)|x|y|argument(?:_relitive|_count|\d)|argument|global|local|other|self)\b/})}Qf.displayName="gap";Qf.aliases=[];function Qf(e){e.languages.gap={shell:{pattern:/^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m,greedy:!0,inside:{gap:{pattern:/^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/,lookbehind:!0,inside:null},punctuation:/^gap>/}},comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/,lookbehind:!0,greedy:!0,inside:{continuation:{pattern:/([\r\n])>/,lookbehind:!0,alias:"punctuation"}}},keyword:/\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:{pattern:/(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,lookbehind:!0},continuation:{pattern:/([\r\n])>/,lookbehind:!0,alias:"punctuation"},operator:/->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./,punctuation:/[()[\]{},;.:]/},e.languages.gap.shell.inside.gap.inside=e.languages.gap}Jf.displayName="gcode";Jf.aliases=[];function Jf(e){e.languages.gcode={comment:/;.*|\B\(.*?\)\B/,string:{pattern:/"(?:""|[^"])*"/,greedy:!0},keyword:/\b[GM]\d+(?:\.\d+)?\b/,property:/\b[A-Z]/,checksum:{pattern:/(\*)\d+/,lookbehind:!0,alias:"number"},punctuation:/[:*]/}}em.displayName="gdscript";em.aliases=[];function em(e){e.languages.gdscript={comment:/#.*/,string:{pattern:/@?(?:("|')(?:(?!\1)[^\n\\]|\\[\s\S])*\1(?!"|')|"""(?:[^\\]|\\[\s\S])*?""")/,greedy:!0},"class-name":{pattern:/(^(?:class|class_name|extends)[ \t]+|^export\([ \t]*|\bas[ \t]+|(?:\b(?:const|var)[ \t]|[,(])[ \t]*\w+[ \t]*:[ \t]*|->[ \t]*)[a-zA-Z_]\w*/m,lookbehind:!0},keyword:/\b(?:and|as|assert|break|breakpoint|class|class_name|const|continue|elif|else|enum|export|extends|for|func|if|in|is|master|mastersync|match|not|null|onready|or|pass|preload|puppet|puppetsync|remote|remotesync|return|self|setget|signal|static|tool|var|while|yield)\b/,function:/\b[a-z_]\w*(?=[ \t]*\()/i,variable:/\$\w+/,number:[/\b0b[01_]+\b|\b0x[\da-fA-F_]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.[\d_]+)(?:e[+-]?[\d_]+)?\b/,/\b(?:INF|NAN|PI|TAU)\b/],constant:/\b[A-Z][A-Z_\d]*\b/,boolean:/\b(?:false|true)\b/,operator:/->|:=|&&|\|\||<<|>>|[-+*/%&|!<>=]=?|[~^]/,punctuation:/[.:,;()[\]{}]/}}tm.displayName="gedcom";tm.aliases=[];function tm(e){e.languages.gedcom={"line-value":{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?\w+ ).+/m,lookbehind:!0,inside:{pointer:{pattern:/^@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@$/,alias:"variable"}}},record:{pattern:/(^[\t ]*\d+ +(?:@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@ +)?)\w+/m,lookbehind:!0,alias:"tag"},level:{pattern:/(^[\t ]*)\d+/m,lookbehind:!0,alias:"number"},pointer:{pattern:/@\w[\w!"$%&'()*+,\-./:;<=>?[\\\]^`{|}~\x80-\xfe #]*@/,alias:"variable"}}}nm.displayName="gettext";nm.aliases=["po"];function nm(e){e.languages.gettext={comment:[{pattern:/# .*/,greedy:!0,alias:"translator-comment"},{pattern:/#\..*/,greedy:!0,alias:"extracted-comment"},{pattern:/#:.*/,greedy:!0,alias:"reference-comment"},{pattern:/#,.*/,greedy:!0,alias:"flag-comment"},{pattern:/#\|.*/,greedy:!0,alias:"previously-untranslated-comment"},{pattern:/#.*/,greedy:!0}],string:{pattern:/(^|[^\\])"(?:[^"\\]|\\.)*"/,lookbehind:!0,greedy:!0},keyword:/^msg(?:ctxt|id|id_plural|str)\b/m,number:/\b\d+\b/,punctuation:/[\[\]]/},e.languages.po=e.languages.gettext}rm.displayName="gherkin";rm.aliases=[];function rm(e){(function(t){var n=/(?:\r?\n|\r)[ \t]*\|.+\|(?:(?!\|).)*/.source;t.languages.gherkin={pystring:{pattern:/("""|''')[\s\S]+?\1/,alias:"string"},comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},tag:{pattern:/(^[ \t]*)@\S*/m,lookbehind:!0},feature:{pattern:/((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|Lastnost|Mak|Mogucnost|laH|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|Potrzeba biznesowa|perbogh|poQbogh malja'|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:\r\n]+(?:\r?\n|\r|$))*/,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]+/,lookbehind:!0},keyword:/[^:\r\n]+:/}},scenario:{pattern:/(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram Senaryo|Dyagram senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|EXAMPLZ|Examples|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|Grundlage|Hannergrond|ghantoH|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut chovnatlh|lut|lutmey|Lýsing Atburðarásar|Lýsing Dæma|MISHUN SRSLY|MISHUN|Menggariskan Senario|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan Senaryo|Plan senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo Deskripsyon|Senaryo deskripsyon|Senaryo|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie Uiteensetting|Situasie|Skenario konsep|Skenario|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa hwaer swa|Swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo-ho-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,lookbehind:!0,inside:{important:{pattern:/(:)[^\r\n]*/,lookbehind:!0},keyword:/[^:\r\n]+:/}},"table-body":{pattern:RegExp("("+n+")(?:"+n+")+"),lookbehind:!0,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"},td:{pattern:/\s*[^\s|][^|]*/,alias:"string"},punctuation:/\|/}},"table-head":{pattern:RegExp(n),inside:{th:{pattern:/\s*[^\s|][^|]*/,alias:"variable"},punctuation:/\|/}},atrule:{pattern:/(^[ \t]+)(?:'a|'ach|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cand|Cando|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|DEN|Dato|De|Den youse gotta|Dengan|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|E|En|Entonces|Epi|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kad|Kada|Kadar|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Ma|Majd|Maka|Manawa|Mas|Men|Menawa|Mutta|Nalika|Nalikaning|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Och|Og|Oletetaan|Ond|Onda|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|Quan|Quand|Quando|qaSDI'|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|Un|Und|ugeholl|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadan|Zadani|Zadano|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,lookbehind:!0},string:{pattern:/"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,inside:{outline:{pattern:/<[^>]+>/,alias:"variable"}}},outline:{pattern:/<[^>]+>/,alias:"variable"}}})(e)}sm.displayName="git";sm.aliases=[];function sm(e){e.languages.git={comment:/^#.*/m,deleted:/^[-–].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m}}am.displayName="glsl";am.aliases=[];function am(e){e.register(Yn),e.languages.glsl=e.languages.extend("c",{keyword:/\b(?:active|asm|atomic_uint|attribute|[ibdu]?vec[234]|bool|break|buffer|case|cast|centroid|class|coherent|common|const|continue|d?mat[234](?:x[234])?|default|discard|do|double|else|enum|extern|external|false|filter|fixed|flat|float|for|fvec[234]|goto|half|highp|hvec[234]|[iu]?sampler2DMS(?:Array)?|[iu]?sampler2DRect|[iu]?samplerBuffer|[iu]?samplerCube|[iu]?samplerCubeArray|[iu]?sampler[123]D|[iu]?sampler[12]DArray|[iu]?image2DMS(?:Array)?|[iu]?image2DRect|[iu]?imageBuffer|[iu]?imageCube|[iu]?imageCubeArray|[iu]?image[123]D|[iu]?image[12]DArray|if|in|inline|inout|input|int|interface|invariant|layout|long|lowp|mediump|namespace|noinline|noperspective|out|output|partition|patch|precise|precision|public|readonly|resource|restrict|return|sample|sampler[12]DArrayShadow|sampler[12]DShadow|sampler2DRectShadow|sampler3DRect|samplerCubeArrayShadow|samplerCubeShadow|shared|short|sizeof|smooth|static|struct|subroutine|superp|switch|template|this|true|typedef|uint|uniform|union|unsigned|using|varying|void|volatile|while|writeonly)\b/})}im.displayName="gn";im.aliases=["gni"];function im(e){e.languages.gn={comment:{pattern:/#.*/,greedy:!0},"string-literal":{pattern:/(^|[^\\"])"(?:[^\r\n"\\]|\\.)*"/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\{[\s\S]*?\}|[a-zA-Z_]\w*|0x[a-fA-F0-9]{2})/,lookbehind:!0,inside:{number:/^\$0x[\s\S]{2}$/,variable:/^\$\w+$/,"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}},string:/[\s\S]+/}},keyword:/\b(?:else|if)\b/,boolean:/\b(?:false|true)\b/,"builtin-function":{pattern:/\b(?:assert|defined|foreach|import|pool|print|template|tool|toolchain)(?=\s*\()/i,alias:"keyword"},function:/\b[a-z_]\w*(?=\s*\()/i,constant:/\b(?:current_cpu|current_os|current_toolchain|default_toolchain|host_cpu|host_os|root_build_dir|root_gen_dir|root_out_dir|target_cpu|target_gen_dir|target_os|target_out_dir)\b/,number:/-?\b\d+\b/,operator:/[-+!=<>]=?|&&|\|\|/,punctuation:/[(){}[\],.]/},e.languages.gn["string-literal"].inside.interpolation.inside.expression.inside=e.languages.gn,e.languages.gni=e.languages.gn}om.displayName="linker-script";om.aliases=["ld"];function om(e){e.languages["linker-script"]={comment:{pattern:/(^|\s)\/\*[\s\S]*?(?:$|\*\/)/,lookbehind:!0,greedy:!0},identifier:{pattern:/"[^"\r\n]*"/,greedy:!0},"location-counter":{pattern:/\B\.\B/,alias:"important"},section:{pattern:/(^|[^\w*])\.\w+\b/,lookbehind:!0,alias:"keyword"},function:/\b[A-Z][A-Z_]*(?=\s*\()/,number:/\b(?:0[xX][a-fA-F0-9]+|\d+)[KM]?\b/,operator:/>>=?|<<=?|->|\+\+|--|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?/,punctuation:/[(){},;]/},e.languages.ld=e.languages["linker-script"]}lm.displayName="go-module";lm.aliases=["go-mod"];function lm(e){e.languages["go-mod"]=e.languages["go-module"]={comment:{pattern:/\/\/.*/,greedy:!0},version:{pattern:/(^|[\s()[\],])v\d+\.\d+\.\d+(?:[+-][-+.\w]*)?(?![^\s()[\],])/,lookbehind:!0,alias:"number"},"go-version":{pattern:/((?:^|\s)go\s+)\d+(?:\.\d+){1,2}/,lookbehind:!0,alias:"number"},keyword:{pattern:/^([ \t]*)(?:exclude|go|module|replace|require|retract)\b/m,lookbehind:!0},operator:/=>/,punctuation:/[()[\],]/}}um.displayName="gradle";um.aliases=[];function um(e){e.register(rt),(function(t){var n={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}};t.languages.gradle=t.languages.extend("clike",{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:apply|def|dependencies|else|if|implementation|import|plugin|plugins|project|repositories|repository|sourceSets|tasks|val)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),t.languages.insertBefore("gradle","string",{shebang:{pattern:/#!.+/,alias:"comment",greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}}}),t.languages.insertBefore("gradle","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),t.languages.insertBefore("gradle","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),n.inside.expression.inside=t.languages.gradle})(e)}cm.displayName="graphql";cm.aliases=[];function cm(e){e.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:e.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},e.hooks.add("after-tokenize",function(n){if(n.language!=="graphql")return;var r=n.tokens.filter(function(y){return typeof y!="string"&&y.type!=="comment"&&y.type!=="scalar"}),s=0;function i(y){return r[s+y]}function o(y,E){E=E||0;for(var v=0;v<y.length;v++){var S=i(v+E);if(!S||S.type!==y[v])return!1}return!0}function l(y,E){for(var v=1,S=s;S<r.length;S++){var A=r[S],N=A.content;if(A.type==="punctuation"&&typeof N=="string"){if(y.test(N))v++;else if(E.test(N)&&(v--,v===0))return S}}return-1}function u(y,E){var v=y.alias;v?Array.isArray(v)||(y.alias=v=[v]):y.alias=v=[],v.push(E)}for(;s<r.length;){var c=r[s++];if(c.type==="keyword"&&c.content==="mutation"){var d=[];if(o(["definition-mutation","punctuation"])&&i(1).content==="("){s+=2;var p=l(/^\($/,/^\)$/);if(p===-1)continue;for(;s<p;s++){var f=i(0);f.type==="variable"&&(u(f,"variable-input"),d.push(f.content))}s=p+1}if(o(["punctuation","property-query"])&&i(0).content==="{"&&(s++,u(i(0),"property-mutation"),d.length>0)){var m=l(/^\{$/,/^\}$/);if(m===-1)continue;for(var b=s;b<m;b++){var x=r[b];x.type==="variable"&&d.indexOf(x.content)>=0&&u(x,"variable-input")}}}}})}dm.displayName="groovy";dm.aliases=[];function dm(e){e.register(rt),(function(t){var n={pattern:/((?:^|[^\\$])(?:\\{2})*)\$(?:\w+|\{[^{}]*\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}};t.languages.groovy=t.languages.extend("clike",{string:{pattern:/'''(?:[^\\]|\\[\s\S])*?'''|'(?:\\.|[^\\'\r\n])*'/,greedy:!0},keyword:/\b(?:abstract|as|assert|boolean|break|byte|case|catch|char|class|const|continue|def|default|do|double|else|enum|extends|final|finally|float|for|goto|if|implements|import|in|instanceof|int|interface|long|native|new|package|private|protected|public|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|trait|transient|try|void|volatile|while)\b/,number:/\b(?:0b[01_]+|0x[\da-f_]+(?:\.[\da-f_p\-]+)?|[\d_]+(?:\.[\d_]+)?(?:e[+-]?\d+)?)[glidf]?\b/i,operator:{pattern:/(^|[^.])(?:~|==?~?|\?[.:]?|\*(?:[.=]|\*=?)?|\.[@&]|\.\.<|\.\.(?!\.)|-[-=>]?|\+[+=]?|!=?|<(?:<=?|=>?)?|>(?:>>?=?|=)?|&[&=]?|\|[|=]?|\/=?|\^=?|%=?)/,lookbehind:!0},punctuation:/\.+|[{}[\];(),:$]/}),t.languages.insertBefore("groovy","string",{shebang:{pattern:/#!.+/,alias:"comment",greedy:!0},"interpolation-string":{pattern:/"""(?:[^\\]|\\[\s\S])*?"""|(["/])(?:\\.|(?!\1)[^\\\r\n])*\1|\$\/(?:[^/$]|\$(?:[/$]|(?![/$]))|\/(?!\$))*\/\$/,greedy:!0,inside:{interpolation:n,string:/[\s\S]+/}}}),t.languages.insertBefore("groovy","punctuation",{"spock-block":/\b(?:and|cleanup|expect|given|setup|then|when|where):/}),t.languages.insertBefore("groovy","function",{annotation:{pattern:/(^|[^.])@\w+/,lookbehind:!0,alias:"punctuation"}}),n.inside.expression.inside=t.languages.groovy})(e)}pm.displayName="textile";pm.aliases=[];function pm(e){e.register(rn),(function(t){var n=/\([^|()\n]+\)|\[[^\]\n]+\]|\{[^}\n]+\}/.source,r=/\)|\((?![^|()\n]+\))/.source;function s(p,f){return RegExp(p.replace(/<MOD>/g,function(){return"(?:"+n+")"}).replace(/<PAR>/g,function(){return"(?:"+r+")"}),f||"")}var i={css:{pattern:/\{[^{}]+\}/,inside:{rest:t.languages.css}},"class-id":{pattern:/(\()[^()]+(?=\))/,lookbehind:!0,alias:"attr-value"},lang:{pattern:/(\[)[^\[\]]+(?=\])/,lookbehind:!0,alias:"attr-value"},punctuation:/[\\\/]\d+|\S/},o=t.languages.textile=t.languages.extend("markup",{phrase:{pattern:/(^|\r|\n)\S[\s\S]*?(?=$|\r?\n\r?\n|\r\r)/,lookbehind:!0,inside:{"block-tag":{pattern:s(/^[a-z]\w*(?:<MOD>|<PAR>|[<>=])*\./.source),inside:{modifier:{pattern:s(/(^[a-z]\w*)(?:<MOD>|<PAR>|[<>=])+(?=\.)/.source),lookbehind:!0,inside:i},tag:/^[a-z]\w*/,punctuation:/\.$/}},list:{pattern:s(/^[*#]+<MOD>*\s+\S.*/.source,"m"),inside:{modifier:{pattern:s(/(^[*#]+)<MOD>+/.source),lookbehind:!0,inside:i},punctuation:/^[*#]+/}},table:{pattern:s(/^(?:(?:<MOD>|<PAR>|[<>=^~])+\.\s*)?(?:\|(?:(?:<MOD>|<PAR>|[<>=^~_]|[\\/]\d+)+\.|(?!(?:<MOD>|<PAR>|[<>=^~_]|[\\/]\d+)+\.))[^|]*)+\|/.source,"m"),inside:{modifier:{pattern:s(/(^|\|(?:\r?\n|\r)?)(?:<MOD>|<PAR>|[<>=^~_]|[\\/]\d+)+(?=\.)/.source),lookbehind:!0,inside:i},punctuation:/\||^\./}},inline:{pattern:s(/(^|[^a-zA-Z\d])(\*\*|__|\?\?|[*_%@+\-^~])<MOD>*.+?\2(?![a-zA-Z\d])/.source),lookbehind:!0,inside:{bold:{pattern:s(/(^(\*\*?)<MOD>*).+?(?=\2)/.source),lookbehind:!0},italic:{pattern:s(/(^(__?)<MOD>*).+?(?=\2)/.source),lookbehind:!0},cite:{pattern:s(/(^\?\?<MOD>*).+?(?=\?\?)/.source),lookbehind:!0,alias:"string"},code:{pattern:s(/(^@<MOD>*).+?(?=@)/.source),lookbehind:!0,alias:"keyword"},inserted:{pattern:s(/(^\+<MOD>*).+?(?=\+)/.source),lookbehind:!0},deleted:{pattern:s(/(^-<MOD>*).+?(?=-)/.source),lookbehind:!0},span:{pattern:s(/(^%<MOD>*).+?(?=%)/.source),lookbehind:!0},modifier:{pattern:s(/(^\*\*|__|\?\?|[*_%@+\-^~])<MOD>+/.source),lookbehind:!0,inside:i},punctuation:/[*_%?@+\-^~]+/}},"link-ref":{pattern:/^\[[^\]]+\]\S+$/m,inside:{string:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0},url:{pattern:/(^\])\S+$/,lookbehind:!0},punctuation:/[\[\]]/}},link:{pattern:s(/"<MOD>*[^"]+":.+?(?=[^\w/]?(?:\s|$))/.source),inside:{text:{pattern:s(/(^"<MOD>*)[^"]+(?=")/.source),lookbehind:!0},modifier:{pattern:s(/(^")<MOD>+/.source),lookbehind:!0,inside:i},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[":]/}},image:{pattern:s(/!(?:<MOD>|<PAR>|[<>=])*(?![<>=])[^!\s()]+(?:\([^)]+\))?!(?::.+?(?=[^\w/]?(?:\s|$)))?/.source),inside:{source:{pattern:s(/(^!(?:<MOD>|<PAR>|[<>=])*)(?![<>=])[^!\s()]+(?:\([^)]+\))?(?=!)/.source),lookbehind:!0,alias:"url"},modifier:{pattern:s(/(^!)(?:<MOD>|<PAR>|[<>=])+/.source),lookbehind:!0,inside:i},url:{pattern:/(:).+/,lookbehind:!0},punctuation:/[!:]/}},footnote:{pattern:/\b\[\d+\]/,alias:"comment",inside:{punctuation:/\[|\]/}},acronym:{pattern:/\b[A-Z\d]+\([^)]+\)/,inside:{comment:{pattern:/(\()[^()]+(?=\))/,lookbehind:!0},punctuation:/[()]/}},mark:{pattern:/\b\((?:C|R|TM)\)/,alias:"comment",inside:{punctuation:/[()]/}}}}}),l=o.phrase.inside,u={inline:l.inline,link:l.link,image:l.image,footnote:l.footnote,acronym:l.acronym,mark:l.mark};o.tag.pattern=/<\/?(?!\d)[a-z0-9]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i;var c=l.inline.inside;c.bold.inside=u,c.italic.inside=u,c.inserted.inside=u,c.deleted.inside=u,c.span.inside=u;var d=l.table.inside;d.inline=u.inline,d.link=u.link,d.image=u.image,d.footnote=u.footnote,d.acronym=u.acronym,d.mark=u.mark})(e)}fm.displayName="haml";fm.aliases=[];function fm(e){e.register(gs),(function(t){t.languages.haml={"multiline-comment":{pattern:/((?:^|\r?\n|\r)([\t ]*))(?:\/|-#).*(?:(?:\r?\n|\r)\2[\t ].+)*/,lookbehind:!0,alias:"comment"},"multiline-code":[{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*,[\t ]*(?:(?:\r?\n|\r)\2[\t ].*,[\t ]*)*(?:(?:\r?\n|\r)\2[\t ].+)/,lookbehind:!0,inside:t.languages.ruby},{pattern:/((?:^|\r?\n|\r)([\t ]*)(?:[~-]|[&!]?=)).*\|[\t ]*(?:(?:\r?\n|\r)\2[\t ].*\|[\t ]*)*/,lookbehind:!0,inside:t.languages.ruby}],filter:{pattern:/((?:^|\r?\n|\r)([\t ]*)):[\w-]+(?:(?:\r?\n|\r)(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"symbol"}}},markup:{pattern:/((?:^|\r?\n|\r)[\t ]*)<.+/,lookbehind:!0,inside:t.languages.markup},doctype:{pattern:/((?:^|\r?\n|\r)[\t ]*)!!!(?: .+)?/,lookbehind:!0},tag:{pattern:/((?:^|\r?\n|\r)[\t ]*)[%.#][\w\-#.]*[\w\-](?:\([^)]+\)|\{(?:\{[^}]+\}|[^{}])+\}|\[[^\]]+\])*[\/<>]*/,lookbehind:!0,inside:{attributes:[{pattern:/(^|[^#])\{(?:\{[^}]+\}|[^{}])+\}/,lookbehind:!0,inside:t.languages.ruby},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*)(?:"(?:\\.|[^\\"\r\n])*"|[^)\s]+)/,lookbehind:!0},"attr-name":/[\w:-]+(?=\s*!?=|\s*[,)])/,punctuation:/[=(),]/}},{pattern:/\[[^\]]+\]/,inside:t.languages.ruby}],punctuation:/[<>]/}},code:{pattern:/((?:^|\r?\n|\r)[\t ]*(?:[~-]|[&!]?=)).+/,lookbehind:!0,inside:t.languages.ruby},interpolation:{pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"punctuation"},ruby:{pattern:/[\s\S]+/,inside:t.languages.ruby}}},punctuation:{pattern:/((?:^|\r?\n|\r)[\t ]*)[~=\-&!]+/,lookbehind:!0}};for(var n="((?:^|\\r?\\n|\\r)([\\t ]*)):{{filter_name}}(?:(?:\\r?\\n|\\r)(?:\\2[\\t ].+|\\s*?(?=\\r?\\n|\\r)))+",r=["css",{filter:"coffee",language:"coffeescript"},"erb","javascript","less","markdown","ruby","scss","textile"],s={},i=0,o=r.length;i<o;i++){var l=r[i];l=typeof l=="string"?{filter:l,language:l}:l,t.languages[l.language]&&(s["filter-"+l.filter]={pattern:RegExp(n.replace("{{filter_name}}",function(){return l.filter})),lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"symbol"},text:{pattern:/[\s\S]+/,alias:[l.language,"language-"+l.language],inside:t.languages[l.language]}}})}t.languages.insertBefore("haml","filter",s)})(e)}mm.displayName="handlebars";mm.aliases=["hbs","mustache"];function mm(e){e.register(dn),(function(t){t.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},t.hooks.add("before-tokenize",function(n){var r=/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g;t.languages["markup-templating"].buildPlaceholders(n,"handlebars",r)}),t.hooks.add("after-tokenize",function(n){t.languages["markup-templating"].tokenizePlaceholders(n,"handlebars")}),t.languages.hbs=t.languages.handlebars,t.languages.mustache=t.languages.handlebars})(e)}Yi.displayName="haskell";Yi.aliases=["hs"];function Yi(e){e.languages.haskell={comment:{pattern:/(^|[^-!#$%*+=?&@|~.:<>^\\\/])(?:--(?:(?=.)[^-!#$%*+=?&@|~.:<>^\\\/].*|$)|\{-[\s\S]*?-\})/m,lookbehind:!0},char:{pattern:/'(?:[^\\']|\\(?:[abfnrtv\\"'&]|\^[A-Z@[\]^_]|ACK|BEL|BS|CAN|CR|DC1|DC2|DC3|DC4|DEL|DLE|EM|ENQ|EOT|ESC|ETB|ETX|FF|FS|GS|HT|LF|NAK|NUL|RS|SI|SO|SOH|SP|STX|SUB|SYN|US|VT|\d+|o[0-7]+|x[0-9a-fA-F]+))'/,alias:"string"},string:{pattern:/"(?:[^\\"]|\\(?:\S|\s+\\))*"/,greedy:!0},keyword:/\b(?:case|class|data|deriving|do|else|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b/,"import-statement":{pattern:/(^[\t ]*)import\s+(?:qualified\s+)?(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*(?:\s+as\s+(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:as|hiding|import|qualified)\b/,punctuation:/\./}},builtin:/\b(?:abs|acos|acosh|all|and|any|appendFile|approxRational|asTypeOf|asin|asinh|atan|atan2|atanh|basicIORun|break|catch|ceiling|chr|compare|concat|concatMap|const|cos|cosh|curry|cycle|decodeFloat|denominator|digitToInt|div|divMod|drop|dropWhile|either|elem|encodeFloat|enumFrom|enumFromThen|enumFromThenTo|enumFromTo|error|even|exp|exponent|fail|filter|flip|floatDigits|floatRadix|floatRange|floor|fmap|foldl|foldl1|foldr|foldr1|fromDouble|fromEnum|fromInt|fromInteger|fromIntegral|fromRational|fst|gcd|getChar|getContents|getLine|group|head|id|inRange|index|init|intToDigit|interact|ioError|isAlpha|isAlphaNum|isAscii|isControl|isDenormalized|isDigit|isHexDigit|isIEEE|isInfinite|isLower|isNaN|isNegativeZero|isOctDigit|isPrint|isSpace|isUpper|iterate|last|lcm|length|lex|lexDigits|lexLitChar|lines|log|logBase|lookup|map|mapM|mapM_|max|maxBound|maximum|maybe|min|minBound|minimum|mod|negate|not|notElem|null|numerator|odd|or|ord|otherwise|pack|pi|pred|primExitWith|print|product|properFraction|putChar|putStr|putStrLn|quot|quotRem|range|rangeSize|read|readDec|readFile|readFloat|readHex|readIO|readInt|readList|readLitChar|readLn|readOct|readParen|readSigned|reads|readsPrec|realToFrac|recip|rem|repeat|replicate|return|reverse|round|scaleFloat|scanl|scanl1|scanr|scanr1|seq|sequence|sequence_|show|showChar|showInt|showList|showLitChar|showParen|showSigned|showString|shows|showsPrec|significand|signum|sin|sinh|snd|sort|span|splitAt|sqrt|subtract|succ|sum|tail|take|takeWhile|tan|tanh|threadToIOResult|toEnum|toInt|toInteger|toLower|toRational|toUpper|truncate|uncurry|undefined|unlines|until|unwords|unzip|unzip3|userError|words|writeFile|zip|zip3|zipWith|zipWith3)\b/,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0o[0-7]+|0x[0-9a-f]+)\b/i,operator:[{pattern:/`(?:[A-Z][\w']*\.)*[_a-z][\w']*`/,greedy:!0},{pattern:/(\s)\.(?=\s)/,lookbehind:!0},/[-!#$%*+=?&@|~:<>^\\\/][-!#$%*+=?&@|~.:<>^\\\/]*|\.[-!#$%*+=?&@|~.:<>^\\\/]+/],hvariable:{pattern:/\b(?:[A-Z][\w']*\.)*[_a-z][\w']*/,inside:{punctuation:/\./}},constant:{pattern:/\b(?:[A-Z][\w']*\.)*[A-Z][\w']*/,inside:{punctuation:/\./}},punctuation:/[{}[\];(),.:]/},e.languages.hs=e.languages.haskell}hm.displayName="haxe";hm.aliases=[];function hm(e){e.register(rt),e.languages.haxe=e.languages.extend("clike",{string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},"class-name":[{pattern:/(\b(?:abstract|class|enum|extends|implements|interface|new|typedef)\s+)[A-Z_]\w*/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\bthis\b|\b(?:abstract|as|break|case|cast|catch|class|continue|default|do|dynamic|else|enum|extends|extern|final|for|from|function|if|implements|import|in|inline|interface|macro|new|null|operator|overload|override|package|private|public|return|static|super|switch|throw|to|try|typedef|untyped|using|var|while)(?!\.)\b/,function:{pattern:/\b[a-z_]\w*(?=\s*(?:<[^<>]*>\s*)?\()/i,greedy:!0},operator:/\.{3}|\+\+|--|&&|\|\||->|=>|(?:<<?|>{1,3}|[-+*/%!=&|^])=?|[?:~]/}),e.languages.insertBefore("haxe","string",{"string-interpolation":{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{interpolation:{pattern:/(^|[^\\])\$(?:\w+|\{[^{}]+\})/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{?|\}$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:e.languages.haxe}}},string:/[\s\S]+/}}}),e.languages.insertBefore("haxe","class-name",{regex:{pattern:/~\/(?:[^\/\\\r\n]|\\.)+\/[a-z]*/,greedy:!0,inside:{"regex-flags":/\b[a-z]+$/,"regex-source":{pattern:/^(~\/)[\s\S]+(?=\/$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^~\/|\/$/}}}),e.languages.insertBefore("haxe","keyword",{preprocessor:{pattern:/#(?:else|elseif|end|if)\b.*/,alias:"property"},metadata:{pattern:/@:?[\w.]+/,alias:"symbol"},reification:{pattern:/\$(?:\w+|(?=\{))/,alias:"important"}})}gm.displayName="hcl";gm.aliases=[];function gm(e){e.languages.hcl={comment:/(?:\/\/|#).*|\/\*[\s\S]*?(?:\*\/|$)/,heredoc:{pattern:/<<-?(\w+\b)[\s\S]*?^[ \t]*\1/m,greedy:!0,alias:"string"},keyword:[{pattern:/(?:data|resource)\s+(?:"(?:\\[\s\S]|[^\\"])*")(?=\s+"[\w-]+"\s+\{)/i,inside:{type:{pattern:/(resource|data|\s+)(?:"(?:\\[\s\S]|[^\\"])*")/i,lookbehind:!0,alias:"variable"}}},{pattern:/(?:backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+(?=\{)/i,inside:{type:{pattern:/(backend|module|output|provider|provisioner|variable)\s+(?:[\w-]+|"(?:\\[\s\S]|[^\\"])*")\s+/i,lookbehind:!0,alias:"variable"}}},/[\w-]+(?=\s+\{)/],property:[/[-\w\.]+(?=\s*=(?!=))/,/"(?:\\[\s\S]|[^\\"])+"(?=\s*[:=])/],string:{pattern:/"(?:[^\\$"]|\\[\s\S]|\$(?:(?=")|\$+(?!\$)|[^"${])|\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\})*"/,greedy:!0,inside:{interpolation:{pattern:/(^|[^$])\$\{(?:[^{}"]|"(?:[^\\"]|\\[\s\S])*")*\}/,lookbehind:!0,inside:{type:{pattern:/(\b(?:count|data|local|module|path|self|terraform|var)\b\.)[\w\*]+/i,lookbehind:!0,alias:"variable"},keyword:/\b(?:count|data|local|module|path|self|terraform|var)\b/i,function:/\w+(?=\()/,string:{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[!\$#%&'()*+,.\/;<=>@\[\\\]^`{|}~?:]/}}}},number:/\b0x[\da-f]+\b|\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,boolean:/\b(?:false|true)\b/i,punctuation:/[=\[\]{}]/}}bm.displayName="hlsl";bm.aliases=[];function bm(e){e.register(Yn),e.languages.hlsl=e.languages.extend("c",{"class-name":[e.languages.c["class-name"],/\b(?:AppendStructuredBuffer|BlendState|Buffer|ByteAddressBuffer|CompileShader|ComputeShader|ConsumeStructuredBuffer|DepthStencilState|DepthStencilView|DomainShader|GeometryShader|Hullshader|InputPatch|LineStream|OutputPatch|PixelShader|PointStream|RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture(?:1D|1DArray|2D|2DArray|3D)|RasterizerState|RenderTargetView|SamplerComparisonState|SamplerState|StructuredBuffer|Texture(?:1D|1DArray|2D|2DArray|2DMS|2DMSArray|3D|Cube|CubeArray)|TriangleStream|VertexShader)\b/],keyword:[/\b(?:asm|asm_fragment|auto|break|case|catch|cbuffer|centroid|char|class|column_major|compile|compile_fragment|const|const_cast|continue|default|delete|discard|do|dynamic_cast|else|enum|explicit|export|extern|for|friend|fxgroup|goto|groupshared|if|in|inline|inout|interface|line|lineadj|linear|long|matrix|mutable|namespace|new|nointerpolation|noperspective|operator|out|packoffset|pass|pixelfragment|point|precise|private|protected|public|register|reinterpret_cast|return|row_major|sample|sampler|shared|short|signed|sizeof|snorm|stateblock|stateblock_state|static|static_cast|string|struct|switch|tbuffer|technique|technique10|technique11|template|texture|this|throw|triangle|triangleadj|try|typedef|typename|uniform|union|unorm|unsigned|using|vector|vertexfragment|virtual|void|volatile|while)\b/,/\b(?:bool|double|dword|float|half|int|min(?:10float|12int|16(?:float|int|uint))|uint)(?:[1-4](?:x[1-4])?)?\b/],number:/(?:(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?|\b0x[\da-fA-F]+)[fFhHlLuU]?\b/,boolean:/\b(?:false|true)\b/})}xm.displayName="hoon";xm.aliases=[];function xm(e){e.languages.hoon={comment:{pattern:/::.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'/,greedy:!0},constant:/%(?:\.[ny]|[\w-]+)/,"class-name":/@(?:[a-z0-9-]*[a-z0-9])?|\*/i,function:/(?:\+[-+] {2})?(?:[a-z](?:[a-z0-9-]*[a-z0-9])?)/,keyword:/\.[\^\+\*=\?]|![><:\.=\?!]|=[>|:,\.\-\^<+;/~\*\?]|\?[>|:\.\-\^<\+&~=@!]|\|[\$_%:\.\-\^~\*=@\?]|\+[|\$\+\*]|:[_\-\^\+~\*]|%[_:\.\-\^\+~\*=]|\^[|:\.\-\+&~\*=\?]|\$[|_%:<>\-\^&~@=\?]|;[:<\+;\/~\*=]|~[>|\$_%<\+\/&=\?!]|--|==/}}ym.displayName="hpkp";ym.aliases=[];function ym(e){e.languages.hpkp={directive:{pattern:/\b(?:includeSubDomains|max-age|pin-sha256|preload|report-to|report-uri|strict)(?=[\s;=]|$)/i,alias:"property"},operator:/=/,punctuation:/;/}}Em.displayName="hsts";Em.aliases=[];function Em(e){e.languages.hsts={directive:{pattern:/\b(?:includeSubDomains|max-age|preload)(?=[\s;=]|$)/i,alias:"property"},operator:/=/,punctuation:/;/}}Sm.displayName="uri";Sm.aliases=["url"];function Sm(e){e.languages.uri={scheme:{pattern:/^[a-z][a-z0-9+.-]*:/im,greedy:!0,inside:{"scheme-delimiter":/:$/}},fragment:{pattern:/#[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"fragment-delimiter":/^#/}},query:{pattern:/\?[\w\-.~!$&'()*+,;=%:@/?]*/,inside:{"query-delimiter":{pattern:/^\?/,greedy:!0},"pair-delimiter":/[&;]/,pair:{pattern:/^[^=][\s\S]*/,inside:{key:/^[^=]+/,value:{pattern:/(^=)[\s\S]+/,lookbehind:!0}}}}},authority:{pattern:RegExp(/^\/\//.source+/(?:[\w\-.~!$&'()*+,;=%:]*@)?/.source+("(?:"+/\[(?:[0-9a-fA-F:.]{2,48}|v[0-9a-fA-F]+\.[\w\-.~!$&'()*+,;=]+)\]/.source+"|"+/[\w\-.~!$&'()*+,;=%]*/.source+")")+/(?::\d*)?/.source,"m"),inside:{"authority-delimiter":/^\/\//,"user-info-segment":{pattern:/^[\w\-.~!$&'()*+,;=%:]*@/,inside:{"user-info-delimiter":/@$/,"user-info":/^[\w\-.~!$&'()*+,;=%:]+/}},"port-segment":{pattern:/:\d*$/,inside:{"port-delimiter":/^:/,port:/^\d+/}},host:{pattern:/[\s\S]+/,inside:{"ip-literal":{pattern:/^\[[\s\S]+\]$/,inside:{"ip-literal-delimiter":/^\[|\]$/,"ipv-future":/^v[\s\S]+/,"ipv6-address":/^[\s\S]+/}},"ipv4-address":/^(?:(?:[03-9]\d?|[12]\d{0,2})\.){3}(?:[03-9]\d?|[12]\d{0,2})$/}}}},path:{pattern:/^[\w\-.~!$&'()*+,;=%:@/]+/m,inside:{"path-separator":/\//}}},e.languages.url=e.languages.uri}Tm.displayName="http";Tm.aliases=[];function Tm(e){(function(t){function n(d){return RegExp("(^(?:"+d+"):[ ]*(?![ ]))[^]+","i")}t.languages.http={"request-line":{pattern:/^(?:CONNECT|DELETE|GET|HEAD|OPTIONS|PATCH|POST|PRI|PUT|SEARCH|TRACE)\s(?:https?:\/\/|\/)\S*\sHTTP\/[\d.]+/m,inside:{method:{pattern:/^[A-Z]+\b/,alias:"property"},"request-target":{pattern:/^(\s)(?:https?:\/\/|\/)\S*(?=\s)/,lookbehind:!0,alias:"url",inside:t.languages.uri},"http-version":{pattern:/^(\s)HTTP\/[\d.]+/,lookbehind:!0,alias:"property"}}},"response-status":{pattern:/^HTTP\/[\d.]+ \d+ .+/m,inside:{"http-version":{pattern:/^HTTP\/[\d.]+/,alias:"property"},"status-code":{pattern:/^(\s)\d+(?=\s)/,lookbehind:!0,alias:"number"},"reason-phrase":{pattern:/^(\s).+/,lookbehind:!0,alias:"string"}}},header:{pattern:/^[\w-]+:.+(?:(?:\r\n?|\n)[ \t].+)*/m,inside:{"header-value":[{pattern:n(/Content-Security-Policy/.source),lookbehind:!0,alias:["csp","languages-csp"],inside:t.languages.csp},{pattern:n(/Public-Key-Pins(?:-Report-Only)?/.source),lookbehind:!0,alias:["hpkp","languages-hpkp"],inside:t.languages.hpkp},{pattern:n(/Strict-Transport-Security/.source),lookbehind:!0,alias:["hsts","languages-hsts"],inside:t.languages.hsts},{pattern:n(/[^:]+/.source),lookbehind:!0}],"header-name":{pattern:/^[^:]+/,alias:"keyword"},punctuation:/^:/}}};var r=t.languages,s={"application/javascript":r.javascript,"application/json":r.json||r.javascript,"application/xml":r.xml,"text/xml":r.xml,"text/html":r.html,"text/css":r.css,"text/plain":r.plain},i={"application/json":!0,"application/xml":!0};function o(d){var p=d.replace(/^[a-z]+\//,""),f="\\w+/(?:[\\w.-]+\\+)+"+p+"(?![+\\w.-])";return"(?:"+d+"|"+f+")"}var l;for(var u in s)if(s[u]){l=l||{};var c=i[u]?o(u):u;l[u.replace(/\//g,"-")]={pattern:RegExp("("+/content-type:\s*/.source+c+/(?:(?:\r\n?|\n)[\w-].*)*(?:\r(?:\n|(?!\n))|\n)/.source+")"+/[^ \t\w-][\s\S]*/.source,"i"),lookbehind:!0,inside:s[u]}}l&&t.languages.insertBefore("http","header",l)})(e)}Nm.displayName="ichigojam";Nm.aliases=[];function Nm(e){e.languages.ichigojam={comment:/(?:\B'|REM)(?:[^\n\r]*)/i,string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i,function:/\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i,label:/(?:\B@\S+)/,operator:/<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i,punctuation:/[\[,;:()\]]/}}wm.displayName="icon";wm.aliases=[];function wm(e){e.languages.icon={comment:/#.*/,string:{pattern:/(["'])(?:(?!\1)[^\\\r\n_]|\\.|_(?!\1)(?:\r\n|[\s\S]))*\1/,greedy:!0},number:/\b(?:\d+r[a-z\d]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b|\.\d+\b/i,"builtin-keyword":{pattern:/&(?:allocated|ascii|clock|collections|cset|current|date|dateline|digits|dump|e|error(?:number|text|value)?|errout|fail|features|file|host|input|lcase|letters|level|line|main|null|output|phi|pi|pos|progname|random|regions|source|storage|subject|time|trace|ucase|version)\b/,alias:"variable"},directive:{pattern:/\$\w+/,alias:"builtin"},keyword:/\b(?:break|by|case|create|default|do|else|end|every|fail|global|if|initial|invocable|link|local|next|not|of|procedure|record|repeat|return|static|suspend|then|to|until|while)\b/,function:/\b(?!\d)\w+(?=\s*[({]|\s*!\s*\[)/,operator:/[+-]:(?!=)|(?:[\/?@^%&]|\+\+?|--?|==?=?|~==?=?|\*\*?|\|\|\|?|<(?:->?|<?=?)|>>?=?)(?::=)?|:(?:=:?)?|[!.\\|~]/,punctuation:/[\[\](){},;]/}}vm.displayName="icu-message-format";vm.aliases=[];function vm(e){(function(t){function n(u,c){return c<=0?/[]/.source:u.replace(/<SELF>/g,function(){return n(u,c-1)})}var r=/'[{}:=,](?:[^']|'')*'(?!')/,s={pattern:/''/,greedy:!0,alias:"operator"},i={pattern:r,greedy:!0,inside:{escape:s}},o=n(/\{(?:[^{}']|'(?![{},'])|''|<STR>|<SELF>)*\}/.source.replace(/<STR>/g,function(){return r.source}),8),l={pattern:RegExp(o),inside:{message:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:null},"message-delimiter":{pattern:/./,alias:"punctuation"}}};t.languages["icu-message-format"]={argument:{pattern:RegExp(o),greedy:!0,inside:{content:{pattern:/^(\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:{"argument-name":{pattern:/^(\s*)[^{}:=,\s]+/,lookbehind:!0},"choice-style":{pattern:/^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{punctuation:/\|/,range:{pattern:/^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/,lookbehind:!0,inside:{operator:/[<#\u2264]/,number:/\S+/}},rest:null}},"plural-style":{pattern:/^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{offset:/^offset:\s*\d+/,"nested-message":l,selector:{pattern:/=\d+|[^{}:=,\s]+/,inside:{keyword:/^(?:few|many|one|other|two|zero)$/}}}},"select-style":{pattern:/^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/,lookbehind:!0,inside:{"nested-message":l,selector:{pattern:/[^{}:=,\s]+/,inside:{keyword:/^other$/}}}},keyword:/\b(?:choice|plural|select|selectordinal)\b/,"arg-type":{pattern:/\b(?:date|duration|number|ordinal|spellout|time)\b/,alias:"keyword"},"arg-skeleton":{pattern:/(,\s*)::[^{}:=,\s]+/,lookbehind:!0},"arg-style":{pattern:/(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/,lookbehind:!0},"arg-style-text":{pattern:RegExp(/(^\s*,\s*(?=\S))/.source+n(/(?:[^{}']|'[^']*'|\{(?:<SELF>)?\})+/.source,8)+"$"),lookbehind:!0,alias:"string"},punctuation:/,/}},"argument-delimiter":{pattern:/./,alias:"operator"}}},escape:s,string:i},l.inside.message.inside=t.languages["icu-message-format"],t.languages["icu-message-format"].argument.inside.content.inside["choice-style"].inside.rest=t.languages["icu-message-format"]})(e)}Am.displayName="idris";Am.aliases=["idr"];function Am(e){e.register(Yi),e.languages.idris=e.languages.extend("haskell",{comment:{pattern:/(?:(?:--|\|\|\|).*$|\{-[\s\S]*?-\})/m},keyword:/\b(?:Type|case|class|codata|constructor|corecord|data|do|dsl|else|export|if|implementation|implicit|import|impossible|in|infix|infixl|infixr|instance|interface|let|module|mutual|namespace|of|parameters|partial|postulate|private|proof|public|quoteGoal|record|rewrite|syntax|then|total|using|where|with)\b/,builtin:void 0}),e.languages.insertBefore("idris","keyword",{"import-statement":{pattern:/(^\s*import\s+)(?:[A-Z][\w']*)(?:\.[A-Z][\w']*)*/m,lookbehind:!0,inside:{punctuation:/\./}}}),e.languages.idr=e.languages.idris}km.displayName="ignore";km.aliases=["gitignore","hgignore","npmignore"];function km(e){(function(t){t.languages.ignore={comment:/^#.*/m,entry:{pattern:/\S(?:.*(?:(?:\\ )|\S))?/,alias:"string",inside:{operator:/^!|\*\*?|\?/,regex:{pattern:/(^|[^\\])\[[^\[\]]*\]/,lookbehind:!0},punctuation:/\//}}},t.languages.gitignore=t.languages.ignore,t.languages.hgignore=t.languages.ignore,t.languages.npmignore=t.languages.ignore})(e)}_m.displayName="inform7";_m.aliases=[];function _m(e){e.languages.inform7={string:{pattern:/"[^"]*"/,inside:{substitution:{pattern:/\[[^\[\]]+\]/,inside:{delimiter:{pattern:/\[|\]/,alias:"punctuation"}}}}},comment:{pattern:/\[[^\[\]]+\]/,greedy:!0},title:{pattern:/^[ \t]*(?:book|chapter|part(?! of)|section|table|volume)\b.+/im,alias:"important"},number:{pattern:/(^|[^-])(?:\b\d+(?:\.\d+)?(?:\^\d+)?(?:(?!\d)\w+)?|\b(?:eight|eleven|five|four|nine|one|seven|six|ten|three|twelve|two))\b(?!-)/i,lookbehind:!0},verb:{pattern:/(^|[^-])\b(?:answering|applying to|are|asking|attacking|be(?:ing)?|burning|buying|called|carries|carry(?! out)|carrying|climbing|closing|conceal(?:ing|s)?|consulting|contain(?:ing|s)?|cutting|drinking|dropping|eating|enclos(?:es?|ing)|entering|examining|exiting|getting|giving|going|ha(?:s|ve|ving)|hold(?:ing|s)?|impl(?:ies|y)|incorporat(?:es?|ing)|inserting|is|jumping|kissing|listening|locking|looking|mean(?:ing|s)?|opening|provid(?:es?|ing)|pulling|pushing|putting|relat(?:es?|ing)|removing|searching|see(?:ing|s)?|setting|showing|singing|sleeping|smelling|squeezing|support(?:ing|s)?|swearing|switching|taking|tasting|telling|thinking|throwing|touching|turning|tying|unlock(?:ing|s)?|var(?:ies|y|ying)|waiting|waking|waving|wear(?:ing|s)?)\b(?!-)/i,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^-])\b(?:after|before|carry out|check|continue the action|definition(?= *:)|do nothing|else|end (?:if|the story|unless)|every turn|if|include|instead(?: of)?|let|move|no|now|otherwise|repeat|report|resume the story|rule for|running through|say(?:ing)?|stop the action|test|try(?:ing)?|understand|unless|use|when|while|yes)\b(?!-)/i,lookbehind:!0},property:{pattern:/(^|[^-])\b(?:adjacent(?! to)|carried|closed|concealed|contained|dark|described|edible|empty|enclosed|enterable|even|female|fixed in place|full|handled|held|improper-named|incorporated|inedible|invisible|lighted|lit|lock(?:able|ed)|male|marked for listing|mentioned|negative|neuter|non-(?:empty|full|recurring)|odd|opaque|open(?:able)?|plural-named|portable|positive|privately-named|proper-named|provided|publically-named|pushable between rooms|recurring|related|rubbing|scenery|seen|singular-named|supported|swinging|switch(?:able|ed(?: off| on)?)|touch(?:able|ed)|transparent|unconcealed|undescribed|unlit|unlocked|unmarked for listing|unmentioned|unopenable|untouchable|unvisited|variable|visible|visited|wearable|worn)\b(?!-)/i,lookbehind:!0,alias:"symbol"},position:{pattern:/(^|[^-])\b(?:above|adjacent to|back side of|below|between|down|east|everywhere|front side|here|in|inside(?: from)?|north(?:east|west)?|nowhere|on(?: top of)?|other side|outside(?: from)?|parts? of|regionally in|south(?:east|west)?|through|up|west|within)\b(?!-)/i,lookbehind:!0,alias:"keyword"},type:{pattern:/(^|[^-])\b(?:actions?|activit(?:ies|y)|actors?|animals?|backdrops?|containers?|devices?|directions?|doors?|holders?|kinds?|lists?|m[ae]n|nobody|nothing|nouns?|numbers?|objects?|people|persons?|player(?:'s holdall)?|regions?|relations?|rooms?|rule(?:book)?s?|scenes?|someone|something|supporters?|tables?|texts?|things?|time|vehicles?|wom[ae]n)\b(?!-)/i,lookbehind:!0,alias:"variable"},punctuation:/[.,:;(){}]/},e.languages.inform7.string.inside.substitution.inside.rest=e.languages.inform7,e.languages.inform7.string.inside.substitution.inside.rest.text={pattern:/\S(?:\s*\S)*/,alias:"comment"}}Cm.displayName="io";Cm.aliases=[];function Cm(e){e.languages.io={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*|#.*)/,lookbehind:!0,greedy:!0},"triple-quoted-string":{pattern:/"""(?:\\[\s\S]|(?!""")[^\\])*"""/,greedy:!0,alias:"string"},string:{pattern:/"(?:\\.|[^\\\r\n"])*"/,greedy:!0},keyword:/\b(?:activate|activeCoroCount|asString|block|break|call|catch|clone|collectGarbage|compileString|continue|do|doFile|doMessage|doString|else|elseif|exit|for|foreach|forward|getEnvironmentVariable|getSlot|hasSlot|if|ifFalse|ifNil|ifNilEval|ifTrue|isActive|isNil|isResumable|list|message|method|parent|pass|pause|perform|performWithArgList|print|println|proto|raise|raiseResumable|removeSlot|resend|resume|schedulerSleepSeconds|self|sender|setSchedulerSleepSeconds|setSlot|shallowCopy|slotNames|super|system|then|thisBlock|thisContext|try|type|uniqueId|updateSlot|wait|while|write|yield)\b/,builtin:/\b(?:Array|AudioDevice|AudioMixer|BigNum|Block|Box|Buffer|CFunction|CGI|Color|Curses|DBM|DNSResolver|DOConnection|DOProxy|DOServer|Date|Directory|Duration|DynLib|Error|Exception|FFT|File|Fnmatch|Font|Future|GL|GLE|GLScissor|GLU|GLUCylinder|GLUQuadric|GLUSphere|GLUT|Host|Image|Importer|LinkList|List|Lobby|Locals|MD5|MP3Decoder|MP3Encoder|Map|Message|Movie|Notification|Number|Object|OpenGL|Point|Protos|Random|Regex|SGML|SGMLElement|SGMLParser|SQLite|Sequence|Server|ShowMessage|SleepyCat|SleepyCatCursor|Socket|SocketManager|Sound|Soup|Store|String|Tree|UDPSender|UPDReceiver|URL|User|Warning|WeakLink)\b/,boolean:/\b(?:false|nil|true)\b/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?/i,operator:/[=!*/%+\-^&|]=|>>?=?|<<?=?|:?:?=|\+\+?|--?|\*\*?|\/\/?|%|\|\|?|&&?|\b(?:and|not|or|return)\b|@@?|\?\??|\.\./,punctuation:/[{}[\];(),.:]/}}Im.displayName="j";Im.aliases=[];function Im(e){e.languages.j={comment:{pattern:/\bNB\..*/,greedy:!0},string:{pattern:/'(?:''|[^'\r\n])*'/,greedy:!0},keyword:/\b(?:(?:CR|LF|adverb|conjunction|def|define|dyad|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,verb:{pattern:/(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,alias:"keyword"},number:/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,adverb:{pattern:/[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,alias:"builtin"},operator:/[=a][.:]|_\./,conjunction:{pattern:/&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,alias:"variable"},punctuation:/[()]/}}ba.displayName="javadoclike";ba.aliases=[];function ba(e){(function(t){var n=t.languages.javadoclike={parameter:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,lookbehind:!0},keyword:{pattern:/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,lookbehind:!0},punctuation:/[{}]/};function r(i,o){var l="doc-comment",u=t.languages[i];if(u){var c=u[l];if(!c){var d={};d[l]={pattern:/(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,lookbehind:!0,alias:"comment"},u=t.languages.insertBefore(i,"comment",d),c=u[l]}if(c instanceof RegExp&&(c=u[l]={pattern:c}),Array.isArray(c))for(var p=0,f=c.length;p<f;p++)c[p]instanceof RegExp&&(c[p]={pattern:c[p]}),o(c[p]);else o(c)}}function s(i,o){typeof i=="string"&&(i=[i]),i.forEach(function(l){r(l,function(u){u.inside||(u.inside={}),u.inside.rest=o})})}Object.defineProperty(n,"addSupport",{value:s}),n.addSupport(["java","javascript","php"],n)})(e)}Rm.displayName="scala";Rm.aliases=[];function Rm(e){e.register(ms),e.languages.scala=e.languages.extend("java",{"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/<-|=>|\b(?:abstract|case|catch|class|def|derives|do|else|enum|extends|extension|final|finally|for|forSome|given|if|implicit|import|infix|inline|lazy|match|new|null|object|opaque|open|override|package|private|protected|return|sealed|self|super|this|throw|trait|transparent|try|type|using|val|var|while|with|yield)\b/,number:/\b0x(?:[\da-f]*\.)?[\da-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e\d+)?[dfl]?/i,builtin:/\b(?:Any|AnyRef|AnyVal|Boolean|Byte|Char|Double|Float|Int|Long|Nothing|Short|String|Unit)\b/,symbol:/'[^\d\s\\]\w*/}),e.languages.insertBefore("scala","triple-quoted-string",{"string-interpolation":{pattern:/\b[a-z]\w*(?:"""(?:[^$]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*?"""|"(?:[^$"\r\n]|\$(?:[^{]|\{(?:[^{}]|\{[^{}]*\})*\}))*")/i,greedy:!0,inside:{id:{pattern:/^\w+/,greedy:!0,alias:"function"},escape:{pattern:/\\\$"|\$[$"]/,greedy:!0,alias:"symbol"},interpolation:{pattern:/\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,greedy:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:e.languages.scala}}},string:/[\s\S]+/}}}),delete e.languages.scala["class-name"],delete e.languages.scala.function,delete e.languages.scala.constant}Dm.displayName="javadoc";Dm.aliases=[];function Dm(e){e.register(ms),e.register(ba),e.register(rn),(function(t){var n=/(^(?:[\t ]*(?:\*\s*)*))[^*\s].*$/m,r=/#\s*\w+(?:\s*\([^()]*\))?/.source,s=/(?:\b[a-zA-Z]\w+\s*\.\s*)*\b[A-Z]\w*(?:\s*<mem>)?|<mem>/.source.replace(/<mem>/g,function(){return r});t.languages.javadoc=t.languages.extend("javadoclike",{}),t.languages.insertBefore("javadoc","keyword",{reference:{pattern:RegExp(/(@(?:exception|link|linkplain|see|throws|value)\s+(?:\*\s*)?)/.source+"(?:"+s+")"),lookbehind:!0,inside:{function:{pattern:/(#\s*)\w+(?=\s*\()/,lookbehind:!0},field:{pattern:/(#\s*)\w+/,lookbehind:!0},namespace:{pattern:/\b(?:[a-z]\w*\s*\.\s*)+/,inside:{punctuation:/\./}},"class-name":/\b[A-Z]\w*/,keyword:t.languages.java.keyword,punctuation:/[#()[\],.]/}},"class-name":{pattern:/(@param\s+)<[A-Z]\w*>/,lookbehind:!0,inside:{punctuation:/[.<>]/}},"code-section":[{pattern:/(\{@code\s+(?!\s))(?:[^\s{}]|\s+(?![\s}])|\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\})+(?=\s*\})/,lookbehind:!0,inside:{code:{pattern:n,lookbehind:!0,inside:t.languages.java,alias:"language-java"}}},{pattern:/(<(code|pre|tt)>(?!<code>)\s*)\S(?:\S|\s+\S)*?(?=\s*<\/\2>)/,lookbehind:!0,inside:{line:{pattern:n,lookbehind:!0,inside:{tag:t.languages.markup.tag,entity:t.languages.markup.entity,code:{pattern:/.+/,inside:t.languages.java,alias:"language-java"}}}}}],tag:t.languages.markup.tag,entity:t.languages.markup.entity}),t.languages.javadoclike.addSupport("java",t.languages.javadoc)})(e)}Om.displayName="javastacktrace";Om.aliases=[];function Om(e){e.languages.javastacktrace={summary:{pattern:/^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m,lookbehind:!0,inside:{keyword:{pattern:/^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,lookbehind:!0},string:{pattern:/^(\s*)"[^"]*"/,lookbehind:!0},exceptions:{pattern:/^(:?\s*)[\w$.]+(?=:|$)/,lookbehind:!0,inside:{"class-name":/[\w$]+$/,namespace:/\b[a-z]\w*\b/,punctuation:/\./}},message:{pattern:/(:\s*)\S.*/,lookbehind:!0,alias:"string"},punctuation:/:/}},"stack-frame":{pattern:/^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:<init>)?\([^()]*\)/m,lookbehind:!0,inside:{keyword:{pattern:/^(\s*)at(?= )/,lookbehind:!0},source:[{pattern:/(\()\w+\.\w+:\d+(?=\))/,lookbehind:!0,inside:{file:/^\w+\.\w+/,punctuation:/:/,"line-number":{pattern:/\b\d+\b/,alias:"number"}}},{pattern:/(\()[^()]*(?=\))/,lookbehind:!0,inside:{keyword:/^(?:Native Method|Unknown Source)$/}}],"class-name":/[\w$]+(?=\.(?:<init>|[\w$]+)\()/,function:/(?:<init>|[\w$]+)(?=\()/,"class-loader":{pattern:/(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/,lookbehind:!0,alias:"namespace",inside:{punctuation:/\./}},module:{pattern:/([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/,lookbehind:!0,inside:{version:{pattern:/(@)[\s\S]+/,lookbehind:!0,alias:"number"},punctuation:/[@.]/}},namespace:{pattern:/(?:\b[a-z]\w*\.)+/,inside:{punctuation:/\./}},punctuation:/[()/.]/}},more:{pattern:/^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m,lookbehind:!0,inside:{punctuation:/\.{3}/,number:/\d+/,keyword:/\b[a-z]+(?: [a-z]+)*\b/}}}}Lm.displayName="jexl";Lm.aliases=[];function Lm(e){e.languages.jexl={string:/(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/,transform:{pattern:/(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/,alias:"function",lookbehind:!0},function:/[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/,number:/\b\d+(?:\.\d+)?\b|\B\.\d+\b/,operator:/[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/,boolean:/\b(?:false|true)\b/,keyword:/\bin\b/,punctuation:/[{}[\](),.]/}}jm.displayName="jolie";jm.aliases=[];function jm(e){e.register(rt),e.languages.jolie=e.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\[\s\S]|[^"\\])*"/,lookbehind:!0,greedy:!0},"class-name":{pattern:/((?:\b(?:as|courier|embed|in|inputPort|outputPort|service)\b|@)[ \t]*)\w+/,lookbehind:!0},keyword:/\b(?:as|cH|comp|concurrent|constants|courier|cset|csets|default|define|else|embed|embedded|execution|exit|extender|for|foreach|forward|from|global|if|import|in|include|init|inputPort|install|instanceof|interface|is_defined|linkIn|linkOut|main|new|nullProcess|outputPort|over|private|provide|public|scope|sequential|service|single|spawn|synchronized|this|throw|throws|type|undef|until|while|with)\b/,function:/\b[a-z_]\w*(?=[ \t]*[@(])/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?l?/i,operator:/-[-=>]?|\+[+=]?|<[<=]?|[>=*!]=?|&&|\|\||[?\/%^@|]/,punctuation:/[()[\]{},;.:]/,builtin:/\b(?:Byte|any|bool|char|double|enum|float|int|length|long|ranges|regex|string|undefined|void)\b/}),e.languages.insertBefore("jolie","keyword",{aggregates:{pattern:/(\bAggregates\s*:\s*)(?:\w+(?:\s+with\s+\w+)?\s*,\s*)*\w+(?:\s+with\s+\w+)?/,lookbehind:!0,inside:{keyword:/\bwith\b/,"class-name":/\w+/,punctuation:/,/}},redirects:{pattern:/(\bRedirects\s*:\s*)(?:\w+\s*=>\s*\w+\s*,\s*)*(?:\w+\s*=>\s*\w+)/,lookbehind:!0,inside:{punctuation:/,/,"class-name":/\w+/,operator:/=>/}},property:{pattern:/\b(?:Aggregates|[Ii]nterfaces|Java|Javascript|Jolie|[Ll]ocation|OneWay|[Pp]rotocol|Redirects|RequestResponse)\b(?=[ \t]*:)/}})}Mm.displayName="jq";Mm.aliases=[];function Mm(e){(function(t){var n=/\\\((?:[^()]|\([^()]*\))*\)/.source,r=RegExp(/(^|[^\\])"(?:[^"\r\n\\]|\\[^\r\n(]|__)*"/.source.replace(/__/g,function(){return n})),s={interpolation:{pattern:RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+n),lookbehind:!0,inside:{content:{pattern:/^(\\\()[\s\S]+(?=\)$)/,lookbehind:!0,inside:null},punctuation:/^\\\(|\)$/}}},i=t.languages.jq={comment:/#.*/,property:{pattern:RegExp(r.source+/(?=\s*:(?!:))/.source),lookbehind:!0,greedy:!0,inside:s},string:{pattern:r,lookbehind:!0,greedy:!0,inside:s},function:{pattern:/(\bdef\s+)[a-z_]\w+/i,lookbehind:!0},variable:/\B\$\w+/,"property-literal":{pattern:/\b[a-z_]\w*(?=\s*:(?!:))/i,alias:"property"},keyword:/\b(?:as|break|catch|def|elif|else|end|foreach|if|import|include|label|module|modulemeta|null|reduce|then|try|while)\b/,boolean:/\b(?:false|true)\b/,number:/(?:\b\d+\.|\B\.)?\b\d+(?:[eE][+-]?\d+)?\b/,operator:[{pattern:/\|=?/,alias:"pipe"},/\.\.|[!=<>]?=|\?\/\/|\/\/=?|[-+*/%]=?|[<>?]|\b(?:and|not|or)\b/],"c-style-function":{pattern:/\b[a-z_]\w*(?=\s*\()/i,alias:"function"},punctuation:/::|[()\[\]{},:;]|\.(?=\s*[\[\w$])/,dot:{pattern:/\./,alias:"important"}};s.interpolation.inside.content.inside=i})(e)}Fm.displayName="js-templates";Fm.aliases=[];function Fm(e){e.register(cn),(function(t){var n=t.languages.javascript["template-string"],r=n.pattern.source,s=n.inside.interpolation,i=s.inside["interpolation-punctuation"],o=s.pattern.source;function l(b,x){if(t.languages[b])return{pattern:RegExp("((?:"+x+")\\s*)"+r),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:b}}}}t.languages.javascript["template-string"]=[l("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),l("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),l("svg",/\bsvg/.source),l("markdown",/\b(?:markdown|md)/.source),l("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),l("sql",/\bsql/.source),n].filter(Boolean);function u(b,x){return"___"+x.toUpperCase()+"_"+b+"___"}function c(b,x,y){var E={code:b,grammar:x,language:y};return t.hooks.run("before-tokenize",E),E.tokens=t.tokenize(E.code,E.grammar),t.hooks.run("after-tokenize",E),E.tokens}function d(b){var x={};x["interpolation-punctuation"]=i;var y=t.tokenize(b,x);if(y.length===3){var E=[1,1];E.push.apply(E,c(y[1],t.languages.javascript,"javascript")),y.splice.apply(y,E)}return new t.Token("interpolation",y,s.alias,b)}function p(b,x,y){var E=t.tokenize(b,{interpolation:{pattern:RegExp(o),lookbehind:!0}}),v=0,S={},A=E.map(function(k){if(typeof k=="string")return k;for(var F=k.content,C;b.indexOf(C=u(v++,y))!==-1;);return S[C]=F,C}).join(""),N=c(A,x,y),T=Object.keys(S);v=0;function w(k){for(var F=0;F<k.length;F++){if(v>=T.length)return;var C=k[F];if(typeof C=="string"||typeof C.content=="string"){var $=T[v],z=typeof C=="string"?C:C.content,M=z.indexOf($);if(M!==-1){++v;var G=z.substring(0,M),H=d(S[$]),j=z.substring(M+$.length),q=[];if(G&&q.push(G),q.push(H),j){var re=[j];w(re),q.push.apply(q,re)}typeof C=="string"?(k.splice.apply(k,[F,1].concat(q)),F+=q.length-1):C.content=q}}else{var pe=C.content;Array.isArray(pe)?w(pe):w([pe])}}}return w(N),new t.Token(y,N,"language-"+y,b)}var f={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};t.hooks.add("after-tokenize",function(b){if(!(b.language in f))return;function x(y){for(var E=0,v=y.length;E<v;E++){var S=y[E];if(typeof S!="string"){var A=S.content;if(!Array.isArray(A)){typeof A!="string"&&x([A]);continue}if(S.type==="template-string"){var N=A[1];if(A.length===3&&typeof N!="string"&&N.type==="embedded-code"){var T=m(N),w=N.alias,k=Array.isArray(w)?w[0]:w,F=t.languages[k];if(!F)continue;A[1]=p(T,F,k)}}else x(A)}}}x(b.tokens)});function m(b){return typeof b=="string"?b:Array.isArray(b)?b.map(m).join(""):m(b.content)}})(e)}Pm.displayName="jsdoc";Pm.aliases=[];function Pm(e){e.register(ba),e.register(cn),e.register(ma),(function(t){var n=t.languages.javascript,r=/\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source,s="(@(?:arg|argument|param|property)\\s+(?:"+r+"\\s+)?)";t.languages.jsdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp(s+/(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source),lookbehind:!0,inside:{punctuation:/\./}}}),t.languages.insertBefore("jsdoc","keyword",{"optional-parameter":{pattern:RegExp(s+/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source),lookbehind:!0,inside:{parameter:{pattern:/(^\[)[$\w\xA0-\uFFFF\.]+/,lookbehind:!0,inside:{punctuation:/\./}},code:{pattern:/(=)[\s\S]*(?=\]$)/,lookbehind:!0,inside:n,alias:"language-javascript"},punctuation:/[=[\]]/}},"class-name":[{pattern:RegExp(/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(/<TYPE>/g,function(){return r})),lookbehind:!0,inside:{punctuation:/\./}},{pattern:RegExp("(@[a-z]+\\s+)"+r),lookbehind:!0,inside:{string:n.string,number:n.number,boolean:n.boolean,keyword:t.languages.typescript.keyword,operator:/=>|\.\.\.|[&|?:*]/,punctuation:/[.,;=<>{}()[\]]/}}],example:{pattern:/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,lookbehind:!0,inside:{code:{pattern:/^([\t ]*(?:\*\s*)?)\S.*$/m,lookbehind:!0,inside:n,alias:"language-javascript"}}}}),t.languages.javadoclike.addSupport("javascript",t.languages.jsdoc)})(e)}Bm.displayName="n4js";Bm.aliases=["n4jsd"];function Bm(e){e.register(cn),e.languages.n4js=e.languages.extend("javascript",{keyword:/\b(?:Array|any|boolean|break|case|catch|class|const|constructor|continue|debugger|declare|default|delete|do|else|enum|export|extends|false|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|module|new|null|number|package|private|protected|public|return|set|static|string|super|switch|this|throw|true|try|typeof|var|void|while|with|yield)\b/}),e.languages.insertBefore("n4js","constant",{annotation:{pattern:/@+\w+/,alias:"operator"}}),e.languages.n4jsd=e.languages.n4js}Um.displayName="js-extras";Um.aliases=[];function Um(e){e.register(cn),(function(t){t.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+t.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),t.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+t.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),t.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]});function n(u,c){return RegExp(u.replace(/<ID>/g,function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source}),c)}t.languages.insertBefore("javascript","keyword",{imports:{pattern:n(/(\bimport\b\s*)(?:<ID>(?:\s*,\s*(?:\*\s*as\s+<ID>|\{[^{}]*\}))?|\*\s*as\s+<ID>|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:t.languages.javascript},exports:{pattern:n(/(\bexport\b\s*)(?:\*(?:\s*as\s+<ID>)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:t.languages.javascript}}),t.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),t.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),t.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:n(/(\.\s*)#?<ID>/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var r=["function","function-variable","method","method-variable","property-access"],s=0;s<r.length;s++){var i=r[s],o=t.languages.javascript[i];t.util.type(o)==="RegExp"&&(o=t.languages.javascript[i]={pattern:o});var l=o.inside||{};o.inside=l,l["maybe-class-name"]=/^[A-Z][\s\S]*/}})(e)}$m.displayName="json5";$m.aliases=[];function $m(e){e.register(pa),(function(t){var n=/("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/;t.languages.json5=t.languages.extend("json",{property:[{pattern:RegExp(n.source+"(?=\\s*:)"),greedy:!0},{pattern:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,alias:"unquoted"}],string:{pattern:n,greedy:!0},number:/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/})})(e)}zm.displayName="jsonp";zm.aliases=[];function zm(e){e.register(pa),e.languages.jsonp=e.languages.extend("json",{punctuation:/[{}[\]();,.]/}),e.languages.insertBefore("jsonp","punctuation",{function:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/})}Hm.displayName="jsstacktrace";Hm.aliases=[];function Hm(e){e.languages.jsstacktrace={"error-message":{pattern:/^\S.*/m,alias:"string"},"stack-frame":{pattern:/(^[ \t]+)at[ \t].*/m,lookbehind:!0,inside:{"not-my-code":{pattern:/^at[ \t]+(?!\s)(?:node\.js|<unknown>|.*(?:node_modules|\(<anonymous>\)|\(<unknown>|<anonymous>$|\(internal\/|\(node\.js)).*/m,alias:"comment"},filename:{pattern:/(\bat\s+(?!\s)|\()(?:[a-zA-Z]:)?[^():]+(?=:)/,lookbehind:!0,alias:"url"},function:{pattern:/(\bat\s+(?:new\s+)?)(?!\s)[_$a-zA-Z\xA0-\uFFFF<][.$\w\xA0-\uFFFF<>]*/,lookbehind:!0,inside:{punctuation:/\./}},punctuation:/[()]/,keyword:/\b(?:at|new)\b/,alias:{pattern:/\[(?:as\s+)?(?!\s)[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\]/,alias:"variable"},"line-number":{pattern:/:\d+(?::\d+)?\b/,alias:"number",inside:{punctuation:/:/}}}}}}Gm.displayName="julia";Gm.aliases=[];function Gm(e){e.languages.julia={comment:{pattern:/(^|[^\\])(?:#=(?:[^#=]|=(?!#)|#(?!=)|#=(?:[^#=]|=(?!#)|#(?!=))*=#)*=#|#.*)/,lookbehind:!0},regex:{pattern:/r"(?:\\.|[^"\\\r\n])*"[imsx]{0,4}/,greedy:!0},string:{pattern:/"""[\s\S]+?"""|(?:\b\w+)?"(?:\\.|[^"\\\r\n])*"|`(?:[^\\`\r\n]|\\.)*`/,greedy:!0},char:{pattern:/(^|[^\w'])'(?:\\[^\r\n][^'\r\n]*|[^\\\r\n])'/,lookbehind:!0,greedy:!0},keyword:/\b(?:abstract|baremodule|begin|bitstype|break|catch|ccall|const|continue|do|else|elseif|end|export|finally|for|function|global|if|immutable|import|importall|in|let|local|macro|module|print|println|quote|return|struct|try|type|typealias|using|while)\b/,boolean:/\b(?:false|true)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[box])?(?:[\da-f]+(?:_[\da-f]+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[efp][+-]?\d+(?:_\d+)*)?j?/i,operator:/&&|\|\||[-+*^%÷⊻&$\\]=?|\/[\/=]?|!=?=?|\|[=>]?|<(?:<=?|[=:|])?|>(?:=|>>?=?)?|==?=?|[~≠≤≥'√∛]/,punctuation:/::?|[{}[\]();,.?]/,constant:/\b(?:(?:Inf|NaN)(?:16|32|64)?|im|pi)\b|[πℯ]/}}Wm.displayName="keepalived";Wm.aliases=[];function Wm(e){e.languages.keepalived={comment:{pattern:/[#!].*/,greedy:!0},string:{pattern:/(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,lookbehind:!0,greedy:!0},ip:{pattern:RegExp(/\b(?:(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){5}:(?:[\da-f]{1,4}:)?[\da-f]{1,4}|(?:[\da-f]{1,4}:){4}:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4}|(?:[\da-f]{1,4}:){3}:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4}|(?:[\da-f]{1,4}:){2}:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}<ipv4>|(?:[\da-f]{1,4}:){0,5}:<ipv4>|::(?:[\da-f]{1,4}:){0,5}<ipv4>|[\da-f]{1,4}::(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4}|::(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:)(?:\/\d{1,3})?|<ipv4>(?:\/\d{1,2})?)\b/.source.replace(/<ipv4>/g,function(){return/(?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d))/.source}),"i"),alias:"number"},path:{pattern:/(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/,lookbehind:!0,alias:"string"},variable:/\$\{?\w+\}?/,email:{pattern:/[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/,alias:"string"},"conditional-configuration":{pattern:/@\^?[\w-]+/,alias:"variable"},operator:/=/,property:/\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/,constant:/\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/,number:{pattern:/(^|[^\w.-])-?\d+(?:\.\d+)?/,lookbehind:!0},boolean:/\b(?:false|no|off|on|true|yes)\b/,punctuation:/[\{\}]/}}qm.displayName="keyman";qm.aliases=[];function qm(e){e.languages.keyman={comment:{pattern:/\bc .*/i,greedy:!0},string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},"virtual-key":{pattern:/\[\s*(?:(?:ALT|CAPS|CTRL|LALT|LCTRL|NCAPS|RALT|RCTRL|SHIFT)\s+)*(?:[TKU]_[\w?]+|[A-E]\d\d?|"[^"\r\n]*"|'[^'\r\n]*')\s*\]/i,greedy:!0,alias:"function"},"header-keyword":{pattern:/&\w+/,alias:"bold"},"header-statement":{pattern:/\b(?:bitmap|bitmaps|caps always off|caps on only|copyright|hotkey|language|layout|message|name|shift frees caps|version)\b/i,alias:"bold"},"rule-keyword":{pattern:/\b(?:any|baselayout|beep|call|context|deadkey|dk|if|index|layer|notany|nul|outs|platform|reset|return|save|set|store|use)\b/i,alias:"keyword"},"structural-keyword":{pattern:/\b(?:ansi|begin|group|match|newcontext|nomatch|postkeystroke|readonly|unicode|using keys)\b/i,alias:"keyword"},"compile-target":{pattern:/\$(?:keyman|keymanonly|keymanweb|kmfl|weaver):/i,alias:"property"},number:/\b(?:U\+[\dA-F]+|d\d+|x[\da-f]+|\d+)\b/i,operator:/[+>\\$]|\.\./,punctuation:/[()=,]/}}Vm.displayName="kumir";Vm.aliases=["kum"];function Vm(e){(function(t){var n=/\s\x00-\x1f\x22-\x2f\x3a-\x3f\x5b-\x5e\x60\x7b-\x7e/.source;function r(s,i){return RegExp(s.replace(/<nonId>/g,n),i)}t.languages.kumir={comment:{pattern:/\|.*/},prolog:{pattern:/#.*/,greedy:!0},string:{pattern:/"[^\n\r"]*"|'[^\n\r']*'/,greedy:!0},boolean:{pattern:r(/(^|[<nonId>])(?:да|нет)(?=[<nonId>]|$)/.source),lookbehind:!0},"operator-word":{pattern:r(/(^|[<nonId>])(?:и|или|не)(?=[<nonId>]|$)/.source),lookbehind:!0,alias:"keyword"},"system-variable":{pattern:r(/(^|[<nonId>])знач(?=[<nonId>]|$)/.source),lookbehind:!0,alias:"keyword"},type:[{pattern:r(/(^|[<nonId>])(?:вещ|лит|лог|сим|цел)(?:\x20*таб)?(?=[<nonId>]|$)/.source),lookbehind:!0,alias:"builtin"},{pattern:r(/(^|[<nonId>])(?:компл|сканкод|файл|цвет)(?=[<nonId>]|$)/.source),lookbehind:!0,alias:"important"}],keyword:{pattern:r(/(^|[<nonId>])(?:алг|арг(?:\x20*рез)?|ввод|ВКЛЮЧИТЬ|вс[её]|выбор|вывод|выход|дано|для|до|дс|если|иначе|исп|использовать|кон(?:(?:\x20+|_)исп)?|кц(?:(?:\x20+|_)при)?|надо|нач|нс|нц|от|пауза|пока|при|раза?|рез|стоп|таб|то|утв|шаг)(?=[<nonId>]|$)/.source),lookbehind:!0},name:{pattern:r(/(^|[<nonId>])[^\d<nonId>][^<nonId>]*(?:\x20+[^<nonId>]+)*(?=[<nonId>]|$)/.source),lookbehind:!0},number:{pattern:r(/(^|[<nonId>])(?:\B\$[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?=[<nonId>]|$)/.source,"i"),lookbehind:!0},punctuation:/:=|[(),:;\[\]]/,"operator-char":{pattern:/\*\*?|<[=>]?|>=?|[-+/=]/,alias:"operator"}},t.languages.kum=t.languages.kumir})(e)}Ym.displayName="kusto";Ym.aliases=[];function Ym(e){e.languages.kusto={comment:{pattern:/\/\/.*/,greedy:!0},string:{pattern:/```[\s\S]*?```|[hH]?(?:"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\.)*'|@(?:"[^\r\n"]*"|'[^\r\n']*'))/,greedy:!0},verb:{pattern:/(\|\s*)[a-z][\w-]*/i,lookbehind:!0,alias:"keyword"},command:{pattern:/\.[a-z][a-z\d-]*\b/,alias:"keyword"},"class-name":/\b(?:bool|datetime|decimal|dynamic|guid|int|long|real|string|timespan)\b/,keyword:/\b(?:access|alias|and|anti|as|asc|auto|between|by|(?:contains|(?:ends|starts)with|has(?:perfix|suffix)?)(?:_cs)?|database|declare|desc|external|from|fullouter|has_all|in|ingestion|inline|inner|innerunique|into|(?:left|right)(?:anti(?:semi)?|inner|outer|semi)?|let|like|local|not|of|on|or|pattern|print|query_parameters|range|restrict|schema|set|step|table|tables|to|view|where|with|matches\s+regex|nulls\s+(?:first|last))(?![\w-])/,boolean:/\b(?:false|null|true)\b/,function:/\b[a-z_]\w*(?=\s*\()/,datetime:[{pattern:/\b(?:(?:Fri|Friday|Mon|Monday|Sat|Saturday|Sun|Sunday|Thu|Thursday|Tue|Tuesday|Wed|Wednesday)\s*,\s*)?\d{1,2}(?:\s+|-)(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)(?:\s+|-)\d{2}\s+\d{2}:\d{2}(?::\d{2})?(?:\s*(?:\b(?:[A-Z]|(?:[ECMT][DS]|GM|U)T)|[+-]\d{4}))?\b/,alias:"number"},{pattern:/[+-]?\b(?:\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)?|\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?)Z?/,alias:"number"}],number:/\b(?:0x[0-9A-Fa-f]+|\d+(?:\.\d+)?(?:[Ee][+-]?\d+)?)(?:(?:min|sec|[mnµ]s|[dhms]|microsecond|tick)\b)?|[+-]?\binf\b/,operator:/=>|[!=]~|[!=<>]=?|[-+*/%|]|\.\./,punctuation:/[()\[\]{},;.:]/}}Km.displayName="latex";Km.aliases=["context","tex"];function Km(e){(function(t){var n=/\\(?:[^a-z()[\]]|[a-z*]+)/i,r={"equation-command":{pattern:n,alias:"regex"}};t.languages.latex={comment:/%.*/,cdata:{pattern:/(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0},equation:[{pattern:/\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,inside:r,alias:"string"},{pattern:/(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,lookbehind:!0,inside:r,alias:"string"}],keyword:{pattern:/(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0},url:{pattern:/(\\url\{)[^}]+(?=\})/,lookbehind:!0},headline:{pattern:/(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,lookbehind:!0,alias:"class-name"},function:{pattern:n,alias:"selector"},punctuation:/[[\]{}&]/},t.languages.tex=t.languages.latex,t.languages.context=t.languages.latex})(e)}Zm.displayName="latte";Zm.aliases=[];function Zm(e){e.register(rt),e.register(dn),e.register(hs),(function(t){t.languages.latte={comment:/^\{\*[\s\S]*/,"latte-tag":{pattern:/(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i,lookbehind:!0,alias:"important"},delimiter:{pattern:/^\{\/?|\}$/,alias:"punctuation"},php:{pattern:/\S(?:[\s\S]*\S)?/,alias:"language-php",inside:t.languages.php}};var n=t.languages.extend("markup",{});t.languages.insertBefore("inside","attr-value",{"n-attr":{pattern:/n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,inside:{"attr-name":{pattern:/^[^\s=]+/,alias:"important"},"attr-value":{pattern:/=[\s\S]+/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}],php:{pattern:/\S(?:[\s\S]*\S)?/,inside:t.languages.php}}}}}},n.tag),t.hooks.add("before-tokenize",function(r){if(r.language==="latte"){var s=/\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g;t.languages["markup-templating"].buildPlaceholders(r,"latte",s),r.grammar=n}}),t.hooks.add("after-tokenize",function(r){t.languages["markup-templating"].tokenizePlaceholders(r,"latte")})})(e)}Ki.displayName="scheme";Ki.aliases=[];function Ki(e){(function(t){t.languages.scheme={comment:/;.*|#;\s*(?:\((?:[^()]|\([^()]*\))*\)|\[(?:[^\[\]]|\[[^\[\]]*\])*\])|#\|(?:[^#|]|#(?!\|)|\|(?!#)|#\|(?:[^#|]|#(?!\|)|\|(?!#))*\|#)*\|#/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},symbol:{pattern:/'[^()\[\]#'\s]+/,greedy:!0},char:{pattern:/#\\(?:[ux][a-fA-F\d]+\b|[-a-zA-Z]+\b|[\uD800-\uDBFF][\uDC00-\uDFFF]|\S)/,greedy:!0},"lambda-parameter":[{pattern:/((?:^|[^'`#])[(\[]lambda\s+)(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)/,lookbehind:!0},{pattern:/((?:^|[^'`#])[(\[]lambda\s+[(\[])[^()\[\]']+/,lookbehind:!0}],keyword:{pattern:/((?:^|[^'`#])[(\[])(?:begin|case(?:-lambda)?|cond(?:-expand)?|define(?:-library|-macro|-record-type|-syntax|-values)?|defmacro|delay(?:-force)?|do|else|except|export|guard|if|import|include(?:-ci|-library-declarations)?|lambda|let(?:rec)?(?:-syntax|-values|\*)?|let\*-values|only|parameterize|prefix|(?:quasi-?)?quote|rename|set!|syntax-(?:case|rules)|unless|unquote(?:-splicing)?|when)(?=[()\[\]\s]|$)/,lookbehind:!0},builtin:{pattern:/((?:^|[^'`#])[(\[])(?:abs|and|append|apply|assoc|ass[qv]|binary-port\?|boolean=?\?|bytevector(?:-append|-copy|-copy!|-length|-u8-ref|-u8-set!|\?)?|caar|cadr|call-with-(?:current-continuation|port|values)|call\/cc|car|cdar|cddr|cdr|ceiling|char(?:->integer|-ready\?|\?|<\?|<=\?|=\?|>\?|>=\?)|close-(?:input-port|output-port|port)|complex\?|cons|current-(?:error|input|output)-port|denominator|dynamic-wind|eof-object\??|eq\?|equal\?|eqv\?|error|error-object(?:-irritants|-message|\?)|eval|even\?|exact(?:-integer-sqrt|-integer\?|\?)?|expt|features|file-error\?|floor(?:-quotient|-remainder|\/)?|flush-output-port|for-each|gcd|get-output-(?:bytevector|string)|inexact\??|input-port(?:-open\?|\?)|integer(?:->char|\?)|lcm|length|list(?:->string|->vector|-copy|-ref|-set!|-tail|\?)?|make-(?:bytevector|list|parameter|string|vector)|map|max|member|memq|memv|min|modulo|negative\?|newline|not|null\?|number(?:->string|\?)|numerator|odd\?|open-(?:input|output)-(?:bytevector|string)|or|output-port(?:-open\?|\?)|pair\?|peek-char|peek-u8|port\?|positive\?|procedure\?|quotient|raise|raise-continuable|rational\?|rationalize|read-(?:bytevector|bytevector!|char|error\?|line|string|u8)|real\?|remainder|reverse|round|set-c[ad]r!|square|string(?:->list|->number|->symbol|->utf8|->vector|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?|<\?|<=\?|=\?|>\?|>=\?)?|substring|symbol(?:->string|\?|=\?)|syntax-error|textual-port\?|truncate(?:-quotient|-remainder|\/)?|u8-ready\?|utf8->string|values|vector(?:->list|->string|-append|-copy|-copy!|-fill!|-for-each|-length|-map|-ref|-set!|\?)?|with-exception-handler|write-(?:bytevector|char|string|u8)|zero\?)(?=[()\[\]\s]|$)/,lookbehind:!0},operator:{pattern:/((?:^|[^'`#])[(\[])(?:[-+*%/]|[<>]=?|=>?)(?=[()\[\]\s]|$)/,lookbehind:!0},number:{pattern:RegExp(n({"<ureal dec>":/\d+(?:\/\d+)|(?:\d+(?:\.\d*)?|\.\d+)(?:[esfdl][+-]?\d+)?/.source,"<real dec>":/[+-]?<ureal dec>|[+-](?:inf|nan)\.0/.source,"<imaginary dec>":/[+-](?:<ureal dec>|(?:inf|nan)\.0)?i/.source,"<complex dec>":/<real dec>(?:@<real dec>|<imaginary dec>)?|<imaginary dec>/.source,"<num dec>":/(?:#d(?:#[ei])?|#[ei](?:#d)?)?<complex dec>/.source,"<ureal box>":/[0-9a-f]+(?:\/[0-9a-f]+)?/.source,"<real box>":/[+-]?<ureal box>|[+-](?:inf|nan)\.0/.source,"<imaginary box>":/[+-](?:<ureal box>|(?:inf|nan)\.0)?i/.source,"<complex box>":/<real box>(?:@<real box>|<imaginary box>)?|<imaginary box>/.source,"<num box>":/#[box](?:#[ei])?|(?:#[ei])?#[box]<complex box>/.source,"<number>":/(^|[()\[\]\s])(?:<num dec>|<num box>)(?=[()\[\]\s]|$)/.source}),"i"),lookbehind:!0},boolean:{pattern:/(^|[()\[\]\s])#(?:[ft]|false|true)(?=[()\[\]\s]|$)/,lookbehind:!0},function:{pattern:/((?:^|[^'`#])[(\[])(?:[^|()\[\]'\s]+|\|(?:[^\\|]|\\.)*\|)(?=[()\[\]\s]|$)/,lookbehind:!0},identifier:{pattern:/(^|[()\[\]\s])\|(?:[^\\|]|\\.)*\|(?=[()\[\]\s]|$)/,lookbehind:!0,greedy:!0},punctuation:/[()\[\]']/};function n(r){for(var s in r)r[s]=r[s].replace(/<[\w\s]+>/g,function(i){return"(?:"+r[i].trim()+")"});return r[s]}})(e)}Xm.displayName="lilypond";Xm.aliases=["ly"];function Xm(e){e.register(Ki),(function(t){for(var n=/\((?:[^();"#\\]|\\[\s\S]|;.*(?!.)|"(?:[^"\\]|\\.)*"|#(?:\{(?:(?!#\})[\s\S])*#\}|[^{])|<expr>)*\)/.source,r=5,s=0;s<r;s++)n=n.replace(/<expr>/g,function(){return n});n=n.replace(/<expr>/g,/[^\s\S]/.source);var i=t.languages.lilypond={comment:/%(?:(?!\{).*|\{[\s\S]*?%\})/,"embedded-scheme":{pattern:RegExp(/(^|[=\s])#(?:"(?:[^"\\]|\\.)*"|[^\s()"]*(?:[^\s()]|<expr>))/.source.replace(/<expr>/g,function(){return n}),"m"),lookbehind:!0,greedy:!0,inside:{scheme:{pattern:/^(#)[\s\S]+$/,lookbehind:!0,alias:"language-scheme",inside:{"embedded-lilypond":{pattern:/#\{[\s\S]*?#\}/,greedy:!0,inside:{punctuation:/^#\{|#\}$/,lilypond:{pattern:/[\s\S]+/,alias:"language-lilypond",inside:null}}},rest:t.languages.scheme}},punctuation:/#/}},string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0},"class-name":{pattern:/(\\new\s+)[\w-]+/,lookbehind:!0},keyword:{pattern:/\\[a-z][-\w]*/i,inside:{punctuation:/^\\/}},operator:/[=|]|<<|>>/,punctuation:{pattern:/(^|[a-z\d])(?:'+|,+|[_^]?-[_^]?(?:[-+^!>._]|(?=\d))|[_^]\.?|[.!])|[{}()[\]<>^~]|\\[()[\]<>\\!]|--|__/,lookbehind:!0},number:/\b\d+(?:\/\d+)?\b/};i["embedded-scheme"].inside.scheme.inside["embedded-lilypond"].inside.lilypond.inside=i,t.languages.ly=i})(e)}Qm.displayName="liquid";Qm.aliases=[];function Qm(e){e.register(dn),e.languages.liquid={comment:{pattern:/(^\{%\s*comment\s*%\})[\s\S]+(?=\{%\s*endcomment\s*%\}$)/,lookbehind:!0},delimiter:{pattern:/^\{(?:\{\{|[%\{])-?|-?(?:\}\}|[%\}])\}$/,alias:"punctuation"},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},keyword:/\b(?:as|assign|break|(?:end)?(?:capture|case|comment|for|form|if|paginate|raw|style|tablerow|unless)|continue|cycle|decrement|echo|else|elsif|in|include|increment|limit|liquid|offset|range|render|reversed|section|when|with)\b/,object:/\b(?:address|all_country_option_tags|article|block|blog|cart|checkout|collection|color|country|country_option_tags|currency|current_page|current_tags|customer|customer_address|date|discount_allocation|discount_application|external_video|filter|filter_value|font|forloop|fulfillment|generic_file|gift_card|group|handle|image|line_item|link|linklist|localization|location|measurement|media|metafield|model|model_source|order|page|page_description|page_image|page_title|part|policy|product|product_option|recommendations|request|robots|routes|rule|script|search|selling_plan|selling_plan_allocation|selling_plan_group|shipping_method|shop|shop_locale|sitemap|store_availability|tax_line|template|theme|transaction|unit_price_measurement|user_agent|variant|video|video_source)\b/,function:[{pattern:/(\|\s*)\w+/,lookbehind:!0,alias:"filter"},{pattern:/(\.\s*)(?:first|last|size)/,lookbehind:!0}],boolean:/\b(?:false|nil|true)\b/,range:{pattern:/\.\./,alias:"operator"},number:/\b\d+(?:\.\d+)?\b/,operator:/[!=]=|<>|[<>]=?|[|?:=-]|\b(?:and|contains(?=\s)|or)\b/,punctuation:/[.,\[\]()]/,empty:{pattern:/\bempty\b/,alias:"keyword"}},e.hooks.add("before-tokenize",function(t){var n=/\{%\s*comment\s*%\}[\s\S]*?\{%\s*endcomment\s*%\}|\{(?:%[\s\S]*?%|\{\{[\s\S]*?\}\}|\{[\s\S]*?\})\}/g,r=!1;e.languages["markup-templating"].buildPlaceholders(t,"liquid",n,function(s){var i=/^\{%-?\s*(\w+)/.exec(s);if(i){var o=i[1];if(o==="raw"&&!r)return r=!0,!0;if(o==="endraw")return r=!1,!0}return!r})}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"liquid")})}Jm.displayName="lisp";Jm.aliases=["elisp","emacs","emacs-lisp"];function Jm(e){(function(t){function n(b){return RegExp(/(\()/.source+"(?:"+b+")"+/(?=[\s\)])/.source)}function r(b){return RegExp(/([\s([])/.source+"(?:"+b+")"+/(?=[\s)])/.source)}var s=/(?!\d)[-+*/~!@$%^=<>{}\w]+/.source,i="&"+s,o="(\\()",l="(?=\\))",u="(?=\\s)",c=/(?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\))*\))*\))*/.source,d={heading:{pattern:/;;;.*/,alias:["comment","title"]},comment:/;.*/,string:{pattern:/"(?:[^"\\]|\\.)*"/,greedy:!0,inside:{argument:/[-A-Z]+(?=[.,\s])/,symbol:RegExp("`"+s+"'")}},"quoted-symbol":{pattern:RegExp("#?'"+s),alias:["variable","symbol"]},"lisp-property":{pattern:RegExp(":"+s),alias:"property"},splice:{pattern:RegExp(",@?"+s),alias:["symbol","variable"]},keyword:[{pattern:RegExp(o+"(?:and|(?:cl-)?letf|cl-loop|cond|cons|error|if|(?:lexical-)?let\\*?|message|not|null|or|provide|require|setq|unless|use-package|when|while)"+u),lookbehind:!0},{pattern:RegExp(o+"(?:append|by|collect|concat|do|finally|for|in|return)"+u),lookbehind:!0}],declare:{pattern:n(/declare/.source),lookbehind:!0,alias:"keyword"},interactive:{pattern:n(/interactive/.source),lookbehind:!0,alias:"keyword"},boolean:{pattern:r(/nil|t/.source),lookbehind:!0},number:{pattern:r(/[-+]?\d+(?:\.\d*)?/.source),lookbehind:!0},defvar:{pattern:RegExp(o+"def(?:const|custom|group|var)\\s+"+s),lookbehind:!0,inside:{keyword:/^def[a-z]+/,variable:RegExp(s)}},defun:{pattern:RegExp(o+/(?:cl-)?(?:defmacro|defun\*?)\s+/.source+s+/\s+\(/.source+c+/\)/.source),lookbehind:!0,greedy:!0,inside:{keyword:/^(?:cl-)?def\S+/,arguments:null,function:{pattern:RegExp("(^\\s)"+s),lookbehind:!0},punctuation:/[()]/}},lambda:{pattern:RegExp(o+"lambda\\s+\\(\\s*(?:&?"+s+"(?:\\s+&?"+s+")*\\s*)?\\)"),lookbehind:!0,greedy:!0,inside:{keyword:/^lambda/,arguments:null,punctuation:/[()]/}},car:{pattern:RegExp(o+s),lookbehind:!0},punctuation:[/(?:['`,]?\(|[)\[\]])/,{pattern:/(\s)\.(?=\s)/,lookbehind:!0}]},p={"lisp-marker":RegExp(i),varform:{pattern:RegExp(/\(/.source+s+/\s+(?=\S)/.source+c+/\)/.source),inside:d},argument:{pattern:RegExp(/(^|[\s(])/.source+s),lookbehind:!0,alias:"variable"},rest:d},f="\\S+(?:\\s+\\S+)*",m={pattern:RegExp(o+c+l),lookbehind:!0,inside:{"rest-vars":{pattern:RegExp("&(?:body|rest)\\s+"+f),inside:p},"other-marker-vars":{pattern:RegExp("&(?:aux|optional)\\s+"+f),inside:p},keys:{pattern:RegExp("&key\\s+"+f+"(?:\\s+&allow-other-keys)?"),inside:p},argument:{pattern:RegExp(s),alias:"variable"},punctuation:/[()]/}};d.lambda.inside.arguments=m,d.defun.inside.arguments=t.util.clone(m),d.defun.inside.arguments.inside.sublist=m,t.languages.lisp=d,t.languages.elisp=d,t.languages.emacs=d,t.languages["emacs-lisp"]=d})(e)}eh.displayName="livescript";eh.aliases=[];function eh(e){e.languages.livescript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\])#.*/,lookbehind:!0}],"interpolated-string":{pattern:/(^|[^"])("""|")(?:\\[\s\S]|(?!\2)[^\\])*\2(?!")/,lookbehind:!0,greedy:!0,inside:{variable:{pattern:/(^|[^\\])#[a-z_](?:-?[a-z]|[\d_])*/m,lookbehind:!0},interpolation:{pattern:/(^|[^\\])#\{[^}]+\}/m,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^#\{|\}$/,alias:"variable"}}},string:/[\s\S]+/}},string:[{pattern:/('''|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/<\[[\s\S]*?\]>/,greedy:!0},/\\[^\s,;\])}]+/],regex:[{pattern:/\/\/(?:\[[^\r\n\]]*\]|\\.|(?!\/\/)[^\\\[])+\/\/[gimyu]{0,5}/,greedy:!0,inside:{comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0}}},{pattern:/\/(?:\[[^\r\n\]]*\]|\\.|[^/\\\r\n\[])+\/[gimyu]{0,5}/,greedy:!0}],keyword:{pattern:/(^|(?!-).)\b(?:break|case|catch|class|const|continue|default|do|else|extends|fallthrough|finally|for(?: ever)?|function|if|implements|it|let|loop|new|null|otherwise|own|return|super|switch|that|then|this|throw|try|unless|until|var|void|when|while|yield)(?!-)\b/m,lookbehind:!0},"keyword-operator":{pattern:/(^|[^-])\b(?:(?:delete|require|typeof)!|(?:and|by|delete|export|from|import(?: all)?|in|instanceof|is(?: not|nt)?|not|of|or|til|to|typeof|with|xor)(?!-)\b)/m,lookbehind:!0,alias:"operator"},boolean:{pattern:/(^|[^-])\b(?:false|no|off|on|true|yes)(?!-)\b/m,lookbehind:!0},argument:{pattern:/(^|(?!\.&\.)[^&])&(?!&)\d*/m,lookbehind:!0,alias:"variable"},number:/\b(?:\d+~[\da-z]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[a-z]\w*)?)/i,identifier:/[a-z_](?:-?[a-z]|[\d_])*/i,operator:[{pattern:/( )\.(?= )/,lookbehind:!0},/\.(?:[=~]|\.\.?)|\.(?:[&|^]|<<|>>>?)\.|:(?:=|:=?)|&&|\|[|>]|<(?:<<?<?|--?!?|~~?!?|[|=?])?|>[>=?]?|-(?:->?|>)?|\+\+?|@@?|%%?|\*\*?|!(?:~?=|--?>|~?~>)?|~(?:~?>|=)?|==?|\^\^?|[\/?]/],punctuation:/[(){}\[\]|.,:;`]/},e.languages.livescript["interpolated-string"].inside.interpolation.inside.rest=e.languages.livescript}th.displayName="llvm";th.aliases=[];function th(e){(function(t){t.languages.llvm={comment:/;.*/,string:{pattern:/"[^"]*"/,greedy:!0},boolean:/\b(?:false|true)\b/,variable:/[%@!#](?:(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+|\d+)/i,label:/(?!\d)(?:[-$.\w]|\\[a-f\d]{2})+:/i,type:{pattern:/\b(?:double|float|fp128|half|i[1-9]\d*|label|metadata|ppc_fp128|token|void|x86_fp80|x86_mmx)\b/,alias:"class-name"},keyword:/\b[a-z_][a-z_0-9]*\b/,number:/[+-]?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-Fa-f]+\b|\b0xK[\dA-Fa-f]{20}\b|\b0x[ML][\dA-Fa-f]{32}\b|\b0xH[\dA-Fa-f]{4}\b/,punctuation:/[{}[\];(),.!*=<>]/}})(e)}nh.displayName="log";nh.aliases=[];function nh(e){e.languages.log={string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,greedy:!0},exception:{pattern:/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,lookbehind:!0,greedy:!0,alias:["javastacktrace","language-javastacktrace"],inside:e.languages.javastacktrace||{keyword:/\bat\b/,function:/[a-z_][\w$]*(?=\()/,punctuation:/[.:()]/}},level:[{pattern:/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,alias:["error","important"]},{pattern:/\b(?:WARN|WARNING|WRN)\b/,alias:["warning","important"]},{pattern:/\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,alias:["info","keyword"]},{pattern:/\b(?:DBG|DEBUG|FINE)\b/,alias:["debug","keyword"]},{pattern:/\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,alias:["trace","comment"]}],property:{pattern:/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,lookbehind:!0},separator:{pattern:/(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,lookbehind:!0,alias:"comment"},url:/\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,email:{pattern:/(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,lookbehind:!0,alias:"url"},"ip-address":{pattern:/\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,alias:"constant"},"mac-address":{pattern:/\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,alias:"constant"},domain:{pattern:/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,lookbehind:!0,alias:"constant"},uuid:{pattern:/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,alias:"constant"},hash:{pattern:/\b(?:[a-f0-9]{32}){1,2}\b/i,alias:"constant"},"file-path":{pattern:/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,lookbehind:!0,greedy:!0,alias:"string"},date:{pattern:RegExp(/\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source+"|"+/\b\d{1,4}[-/ ](?:\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\d{2,4}T?\b/.source+"|"+/\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\s{1,2}\d{1,2}\b/.source,"i"),alias:"number"},time:{pattern:/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,alias:"number"},boolean:/\b(?:false|null|true)\b/i,number:{pattern:/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,lookbehind:!0},operator:/[;:?<=>~/@!$%&+\-|^(){}*#]/,punctuation:/[\[\].,]/}}rh.displayName="lolcode";rh.aliases=[];function rh(e){e.languages.lolcode={comment:[/\bOBTW\s[\s\S]*?\sTLDR\b/,/\bBTW.+/],string:{pattern:/"(?::.|[^":])*"/,inside:{variable:/:\{[^}]+\}/,symbol:[/:\([a-f\d]+\)/i,/:\[[^\]]+\]/,/:[)>o":]/]},greedy:!0},number:/(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,symbol:{pattern:/(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/,lookbehind:!0,inside:{keyword:/A(?=\s)/}},label:{pattern:/((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,lookbehind:!0,alias:"string"},function:{pattern:/((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/,lookbehind:!0},keyword:[{pattern:/(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/,lookbehind:!0},/'Z(?=\s|,|$)/],boolean:{pattern:/(^|\s)(?:FAIL|WIN)(?=\s|,|$)/,lookbehind:!0},variable:{pattern:/(^|\s)IT(?=\s|,|$)/,lookbehind:!0},operator:{pattern:/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/,lookbehind:!0},punctuation:/\.{3}|…|,|!/}}sh.displayName="magma";sh.aliases=[];function sh(e){e.languages.magma={output:{pattern:/^(>.*(?:\r(?:\n|(?!\n))|\n))(?!>)(?:.+|(?:\r(?:\n|(?!\n))|\n)(?!>).*)(?:(?:\r(?:\n|(?!\n))|\n)(?!>).*)*/m,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/(^|[^\\"])"(?:[^\r\n\\"]|\\.)*"/,lookbehind:!0,greedy:!0},keyword:/\b(?:_|adj|and|assert|assert2|assert3|assigned|break|by|case|cat|catch|clear|cmpeq|cmpne|continue|declare|default|delete|diff|div|do|elif|else|end|eq|error|eval|exists|exit|for|forall|forward|fprintf|freeze|function|ge|gt|if|iload|import|in|intrinsic|is|join|le|load|local|lt|meet|mod|ne|not|notadj|notin|notsubset|or|print|printf|procedure|quit|random|read|readi|repeat|require|requirege|requirerange|restore|return|save|sdiff|select|subset|then|time|to|try|until|vprint|vprintf|vtime|when|where|while|xor)\b/,boolean:/\b(?:false|true)\b/,generator:{pattern:/\b[a-z_]\w*(?=\s*<)/i,alias:"class-name"},function:/\b[a-z_]\w*(?=\s*\()/i,number:{pattern:/(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,lookbehind:!0},operator:/->|[-+*/^~!|#=]|:=|\.\./,punctuation:/[()[\]{}<>,;.:]/}}bu.displayName="mata";bu.aliases=[];function bu(e){(function(t){var n=/\b(?:(?:col|row)?vector|matrix|scalar)\b/.source,r=/\bvoid\b|<org>|\b(?:complex|numeric|pointer(?:\s*\([^()]*\))?|real|string|(?:class|struct)\s+\w+|transmorphic)(?:\s*<org>)?/.source.replace(/<org>/g,n);t.languages.mata={comment:{pattern:/\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//,greedy:!0},string:{pattern:/"[^"\r\n]*"|[‘`']".*?"[’`']/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|struct)\s+)\w+(?=\s*(?:\{|\bextends\b))/,lookbehind:!0},type:{pattern:RegExp(r),alias:"class-name",inside:{punctuation:/[()]/,keyword:/\b(?:class|function|struct|void)\b/}},keyword:/\b(?:break|class|continue|do|else|end|extends|external|final|for|function|goto|if|pragma|private|protected|public|return|static|struct|unset|unused|version|virtual|while)\b/,constant:/\bNULL\b/,number:{pattern:/(^|[^\w.])(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|\d[a-f0-9]*(?:\.[a-f0-9]+)?x[+-]?\d+)i?(?![\w.])/i,lookbehind:!0},missing:{pattern:/(^|[^\w.])(?:\.[a-z]?)(?![\w.])/,lookbehind:!0,alias:"symbol"},function:/\b[a-z_]\w*(?=\s*\()/i,operator:/\.\.|\+\+|--|&&|\|\||:?(?:[!=<>]=|[+\-*/^<>&|:])|[!?=\\#’`']/,punctuation:/[()[\]{},;.]/}})(e)}ah.displayName="matlab";ah.aliases=[];function ah(e){e.languages.matlab={comment:[/%\{[\s\S]*?\}%/,/%.+/],string:{pattern:/\B'(?:''|[^'\r\n])*'/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+)?(?:[ij])?|\b[ij]\b/,keyword:/\b(?:NaN|break|case|catch|continue|else|elseif|end|for|function|if|inf|otherwise|parfor|pause|pi|return|switch|try|while)\b/,function:/\b(?!\d)\w+(?=\s*\()/,operator:/\.?[*^\/\\']|[+\-:@]|[<>=~]=?|&&?|\|\|?/,punctuation:/\.{3}|[.,;\[\](){}!]/}}ih.displayName="maxscript";ih.aliases=[];function ih(e){(function(t){var n=/\b(?:about|and|animate|as|at|attributes|by|case|catch|collect|continue|coordsys|do|else|exit|fn|for|from|function|global|if|in|local|macroscript|mapped|max|not|of|off|on|or|parameters|persistent|plugin|rcmenu|return|rollout|set|struct|then|throw|to|tool|try|undo|utility|when|where|while|with)\b/i;t.languages.maxscript={comment:{pattern:/\/\*[\s\S]*?(?:\*\/|$)|--.*/,greedy:!0},string:{pattern:/(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/,lookbehind:!0,greedy:!0},path:{pattern:/\$(?:[\w/\\.*?]|'[^']*')*/,greedy:!0,alias:"string"},"function-call":{pattern:RegExp("((?:"+(/^/.source+"|"+/[;=<>+\-*/^({\[]/.source+"|"+/\b(?:and|by|case|catch|collect|do|else|if|in|not|or|return|then|to|try|where|while|with)\b/.source)+")[ ]*)(?!"+n.source+")"+/[a-z_]\w*\b/.source+"(?=[ ]*(?:"+("(?!"+n.source+")"+/[a-z_]/.source+"|"+/\d|-\.?\d/.source+"|"+/[({'"$@#?]/.source)+"))","im"),lookbehind:!0,greedy:!0,alias:"function"},"function-definition":{pattern:/(\b(?:fn|function)\s+)\w+\b/i,lookbehind:!0,alias:"function"},argument:{pattern:/\b[a-z_]\w*(?=:)/i,alias:"attr-name"},keyword:n,boolean:/\b(?:false|true)\b/,time:{pattern:/(^|[^\w.])(?:(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?[msft])+|\d+:\d+(?:\.\d*)?)(?![\w.:])/,lookbehind:!0,alias:"number"},number:[{pattern:/(^|[^\w.])(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?|0x[a-fA-F0-9]+)(?![\w.:])/,lookbehind:!0},/\b(?:e|pi)\b/],constant:/\b(?:dontcollect|ok|silentValue|undefined|unsupplied)\b/,color:{pattern:/\b(?:black|blue|brown|gray|green|orange|red|white|yellow)\b/i,alias:"constant"},operator:/[-+*/<>=!]=?|[&^?]|#(?!\()/,punctuation:/[()\[\]{}.:,;]|#(?=\()|\\$/m}})(e)}oh.displayName="mel";oh.aliases=[];function oh(e){e.languages.mel={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},code:{pattern:/`(?:\\.|[^\\`])*`/,greedy:!0,alias:"italic",inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},statement:{pattern:/[\s\S]+/,inside:null}}},string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},variable:/\$\w+/,number:/\b0x[\da-fA-F]+\b|\b\d+(?:\.\d*)?|\B\.\d+/,flag:{pattern:/-[^\d\W]\w*/,alias:"operator"},keyword:/\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,function:{pattern:/((?:^|[{;])[ \t]*)[a-z_]\w*\b(?!\s*(?:\.(?!\.)|[[{=]))|\b[a-z_]\w*(?=[ \t]*\()/im,lookbehind:!0,greedy:!0},"tensor-punctuation":{pattern:/<<|>>/,alias:"punctuation"},operator:/\+[+=]?|-[-=]?|&&|\|\||[<>]=?|[*\/!=]=?|[%^]/,punctuation:/[.,:;?\[\](){}]/},e.languages.mel.code.inside.statement.inside=e.languages.mel}lh.displayName="mermaid";lh.aliases=[];function lh(e){e.languages.mermaid={comment:{pattern:/%%.*/,greedy:!0},style:{pattern:/^([ \t]*(?:classDef|linkStyle|style)[ \t]+[\w$-]+[ \t]+)\w.*[^\s;]/m,lookbehind:!0,inside:{property:/\b\w[\w-]*(?=[ \t]*:)/,operator:/:/,punctuation:/,/}},"inter-arrow-label":{pattern:/([^<>ox.=-])(?:-[-.]|==)(?![<>ox.=-])[ \t]*(?:"[^"\r\n]*"|[^\s".=-](?:[^\r\n.=-]*[^\s.=-])?)[ \t]*(?:\.+->?|--+[->]|==+[=>])(?![<>ox.=-])/,lookbehind:!0,greedy:!0,inside:{arrow:{pattern:/(?:\.+->?|--+[->]|==+[=>])$/,alias:"operator"},label:{pattern:/^([\s\S]{2}[ \t]*)\S(?:[\s\S]*\S)?/,lookbehind:!0,alias:"property"},"arrow-head":{pattern:/^\S+/,alias:["arrow","operator"]}}},arrow:[{pattern:/(^|[^{}|o.-])[|}][|o](?:--|\.\.)[|o][|{](?![{}|o.-])/,lookbehind:!0,alias:"operator"},{pattern:/(^|[^<>ox.=-])(?:[<ox](?:==+|--+|-\.*-)[>ox]?|(?:==+|--+|-\.*-)[>ox]|===+|---+|-\.+-)(?![<>ox.=-])/,lookbehind:!0,alias:"operator"},{pattern:/(^|[^<>()x-])(?:--?(?:>>|[x>)])(?![<>()x])|(?:<<|[x<(])--?(?!-))/,lookbehind:!0,alias:"operator"},{pattern:/(^|[^<>|*o.-])(?:[*o]--|--[*o]|<\|?(?:--|\.\.)|(?:--|\.\.)\|?>|--|\.\.)(?![<>|*o.-])/,lookbehind:!0,alias:"operator"}],label:{pattern:/(^|[^|<])\|(?:[^\r\n"|]|"[^"\r\n]*")+\|/,lookbehind:!0,greedy:!0,alias:"property"},text:{pattern:/(?:[(\[{]+|\b>)(?:[^\r\n"()\[\]{}]|"[^"\r\n]*")+(?:[)\]}]+|>)/,alias:"string"},string:{pattern:/"[^"\r\n]*"/,greedy:!0},annotation:{pattern:/<<(?:abstract|choice|enumeration|fork|interface|join|service)>>|\[\[(?:choice|fork|join)\]\]/i,alias:"important"},keyword:[{pattern:/(^[ \t]*)(?:action|callback|class|classDef|classDiagram|click|direction|erDiagram|flowchart|gantt|gitGraph|graph|journey|link|linkStyle|pie|requirementDiagram|sequenceDiagram|stateDiagram|stateDiagram-v2|style|subgraph)(?![\w$-])/m,lookbehind:!0,greedy:!0},{pattern:/(^[ \t]*)(?:activate|alt|and|as|autonumber|deactivate|else|end(?:[ \t]+note)?|loop|opt|par|participant|rect|state|note[ \t]+(?:over|(?:left|right)[ \t]+of))(?![\w$-])/im,lookbehind:!0,greedy:!0}],entity:/#[a-z0-9]+;/,operator:{pattern:/(\w[ \t]*)&(?=[ \t]*\w)|:::|:/,lookbehind:!0},punctuation:/[(){};]/}}uh.displayName="metafont";uh.aliases=[];function uh(e){e.languages.metafont={comment:{pattern:/%.*/,greedy:!0},string:{pattern:/"[^\r\n"]*"/,greedy:!0},number:/\d*\.?\d+/,boolean:/\b(?:false|true)\b/,punctuation:[/[,;()]/,{pattern:/(^|[^{}])(?:\{|\})(?![{}])/,lookbehind:!0},{pattern:/(^|[^[])\[(?!\[)/,lookbehind:!0},{pattern:/(^|[^\]])\](?!\])/,lookbehind:!0}],constant:[{pattern:/(^|[^!?])\?\?\?(?![!?])/,lookbehind:!0},{pattern:/(^|[^/*\\])(?:\\|\\\\)(?![/*\\])/,lookbehind:!0},/\b(?:_|blankpicture|bp|cc|cm|dd|ditto|down|eps|epsilon|fullcircle|halfcircle|identity|in|infinity|left|mm|nullpen|nullpicture|origin|pc|penrazor|penspeck|pensquare|penstroke|proof|pt|quartercircle|relax|right|smoke|unitpixel|unitsquare|up)\b/],quantity:{pattern:/\b(?:autorounding|blacker|boundarychar|charcode|chardp|chardx|chardy|charext|charht|charic|charwd|currentwindow|day|designsize|displaying|fillin|fontmaking|granularity|hppp|join_radius|month|o_correction|pausing|pen_(?:bot|lft|rt|top)|pixels_per_inch|proofing|showstopping|smoothing|time|tolerance|tracingcapsules|tracingchoices|tracingcommands|tracingedges|tracingequations|tracingmacros|tracingonline|tracingoutput|tracingpens|tracingrestores|tracingspecs|tracingstats|tracingtitles|turningcheck|vppp|warningcheck|xoffset|year|yoffset)\b/,alias:"keyword"},command:{pattern:/\b(?:addto|batchmode|charlist|cull|display|errhelp|errmessage|errorstopmode|everyjob|extensible|fontdimen|headerbyte|inner|interim|let|ligtable|message|newinternal|nonstopmode|numspecial|openwindow|outer|randomseed|save|scrollmode|shipout|show|showdependencies|showstats|showtoken|showvariable|special)\b/,alias:"builtin"},operator:[{pattern:/(^|[^>=<:|])(?:<|<=|=|=:|\|=:|\|=:>|=:\|>|=:\||\|=:\||\|=:\|>|\|=:\|>>|>|>=|:|:=|<>|::|\|\|:)(?![>=<:|])/,lookbehind:!0},{pattern:/(^|[^+-])(?:\+|\+\+|-{1,3}|\+-\+)(?![+-])/,lookbehind:!0},{pattern:/(^|[^/*\\])(?:\*|\*\*|\/)(?![/*\\])/,lookbehind:!0},{pattern:/(^|[^.])(?:\.{2,3})(?!\.)/,lookbehind:!0},{pattern:/(^|[^@#&$])&(?![@#&$])/,lookbehind:!0},/\b(?:and|not|or)\b/],macro:{pattern:/\b(?:abs|beginchar|bot|byte|capsule_def|ceiling|change_width|clear_pen_memory|clearit|clearpen|clearxy|counterclockwise|cullit|cutdraw|cutoff|decr|define_blacker_pixels|define_corrected_pixels|define_good_x_pixels|define_good_y_pixels|define_horizontal_corrected_pixels|define_pixels|define_whole_blacker_pixels|define_whole_pixels|define_whole_vertical_blacker_pixels|define_whole_vertical_pixels|dir|direction|directionpoint|div|dotprod|downto|draw|drawdot|endchar|erase|fill|filldraw|fix_units|flex|font_coding_scheme|font_extra_space|font_identifier|font_normal_shrink|font_normal_space|font_normal_stretch|font_quad|font_size|font_slant|font_x_height|gfcorners|gobble|gobbled|good\.(?:bot|lft|rt|top|x|y)|grayfont|hide|hround|imagerules|incr|interact|interpath|intersectionpoint|inverse|italcorr|killtext|labelfont|labels|lft|loggingall|lowres_fix|makegrid|makelabel(?:\.(?:bot|lft|rt|top)(?:\.nodot)?)?|max|min|mod|mode_def|mode_setup|nodisplays|notransforms|numtok|openit|penlabels|penpos|pickup|proofoffset|proofrule|proofrulethickness|range|reflectedabout|rotatedabout|rotatedaround|round|rt|savepen|screenchars|screenrule|screenstrokes|shipit|showit|slantfont|softjoin|solve|stop|superellipse|tensepath|thru|titlefont|top|tracingall|tracingnone|undraw|undrawdot|unfill|unfilldraw|upto|vround)\b/,alias:"function"},builtin:/\b(?:ASCII|angle|char|cosd|decimal|directiontime|floor|hex|intersectiontimes|jobname|known|length|makepath|makepen|mexp|mlog|normaldeviate|oct|odd|pencircle|penoffset|point|postcontrol|precontrol|reverse|rotated|sind|sqrt|str|subpath|substring|totalweight|turningnumber|uniformdeviate|unknown|xpart|xxpart|xypart|ypart|yxpart|yypart)\b/,keyword:/\b(?:also|at|atleast|begingroup|charexists|contour|controls|curl|cycle|def|delimiters|doublepath|dropping|dump|else|elseif|end|enddef|endfor|endgroup|endinput|exitif|exitunless|expandafter|fi|for|forever|forsuffixes|from|if|input|inwindow|keeping|kern|of|primarydef|quote|readstring|scaled|scantokens|secondarydef|shifted|skipto|slanted|step|tension|tertiarydef|to|transformed|until|vardef|withpen|withweight|xscaled|yscaled|zscaled)\b/,type:{pattern:/\b(?:boolean|expr|numeric|pair|path|pen|picture|primary|secondary|string|suffix|tertiary|text|transform)\b/,alias:"property"},variable:{pattern:/(^|[^@#&$])(?:@#|#@|#|@)(?![@#&$])|\b(?:aspect_ratio|currentpen|currentpicture|currenttransform|d|extra_beginchar|extra_endchar|extra_setup|h|localfont|mag|mode|screen_cols|screen_rows|w|whatever|x|y|z)\b/,lookbehind:!0}}}ch.displayName="mizar";ch.aliases=[];function ch(e){e.languages.mizar={comment:/::.+/,keyword:/@proof\b|\b(?:according|aggregate|all|and|antonym|are|as|associativity|assume|asymmetry|attr|be|begin|being|by|canceled|case|cases|clusters?|coherence|commutativity|compatibility|connectedness|consider|consistency|constructors|contradiction|correctness|def|deffunc|define|definitions?|defpred|do|does|end|environ|equals|ex|exactly|existence|for|from|func|given|hence|hereby|holds|idempotence|identity|iff?|implies|involutiveness|irreflexivity|is|it|let|means|mode|non|not|notations?|now|of|or|otherwise|over|per|pred|prefix|projectivity|proof|provided|qua|reconsider|redefine|reduce|reducibility|reflexivity|registrations?|requirements|reserve|sch|schemes?|section|selector|set|sethood|st|struct|such|suppose|symmetry|synonym|take|that|the|then|theorems?|thesis|thus|to|transitivity|uniqueness|vocabular(?:ies|y)|when|where|with|wrt)\b/,parameter:{pattern:/\$(?:10|\d)/,alias:"variable"},variable:/\b\w+(?=:)/,number:/(?:\b|-)\d+\b/,operator:/\.\.\.|->|&|\.?=/,punctuation:/\(#|#\)|[,:;\[\](){}]/}}dh.displayName="mongodb";dh.aliases=[];function dh(e){e.register(cn),(function(t){var n=["$eq","$gt","$gte","$in","$lt","$lte","$ne","$nin","$and","$not","$nor","$or","$exists","$type","$expr","$jsonSchema","$mod","$regex","$text","$where","$geoIntersects","$geoWithin","$near","$nearSphere","$all","$elemMatch","$size","$bitsAllClear","$bitsAllSet","$bitsAnyClear","$bitsAnySet","$comment","$elemMatch","$meta","$slice","$currentDate","$inc","$min","$max","$mul","$rename","$set","$setOnInsert","$unset","$addToSet","$pop","$pull","$push","$pullAll","$each","$position","$slice","$sort","$bit","$addFields","$bucket","$bucketAuto","$collStats","$count","$currentOp","$facet","$geoNear","$graphLookup","$group","$indexStats","$limit","$listLocalSessions","$listSessions","$lookup","$match","$merge","$out","$planCacheStats","$project","$redact","$replaceRoot","$replaceWith","$sample","$set","$skip","$sort","$sortByCount","$unionWith","$unset","$unwind","$setWindowFields","$abs","$accumulator","$acos","$acosh","$add","$addToSet","$allElementsTrue","$and","$anyElementTrue","$arrayElemAt","$arrayToObject","$asin","$asinh","$atan","$atan2","$atanh","$avg","$binarySize","$bsonSize","$ceil","$cmp","$concat","$concatArrays","$cond","$convert","$cos","$dateFromParts","$dateToParts","$dateFromString","$dateToString","$dayOfMonth","$dayOfWeek","$dayOfYear","$degreesToRadians","$divide","$eq","$exp","$filter","$first","$floor","$function","$gt","$gte","$hour","$ifNull","$in","$indexOfArray","$indexOfBytes","$indexOfCP","$isArray","$isNumber","$isoDayOfWeek","$isoWeek","$isoWeekYear","$last","$last","$let","$literal","$ln","$log","$log10","$lt","$lte","$ltrim","$map","$max","$mergeObjects","$meta","$min","$millisecond","$minute","$mod","$month","$multiply","$ne","$not","$objectToArray","$or","$pow","$push","$radiansToDegrees","$range","$reduce","$regexFind","$regexFindAll","$regexMatch","$replaceOne","$replaceAll","$reverseArray","$round","$rtrim","$second","$setDifference","$setEquals","$setIntersection","$setIsSubset","$setUnion","$size","$sin","$slice","$split","$sqrt","$stdDevPop","$stdDevSamp","$strcasecmp","$strLenBytes","$strLenCP","$substr","$substrBytes","$substrCP","$subtract","$sum","$switch","$tan","$toBool","$toDate","$toDecimal","$toDouble","$toInt","$toLong","$toObjectId","$toString","$toLower","$toUpper","$trim","$trunc","$type","$week","$year","$zip","$count","$dateAdd","$dateDiff","$dateSubtract","$dateTrunc","$getField","$rand","$sampleRate","$setField","$unsetField","$comment","$explain","$hint","$max","$maxTimeMS","$min","$orderby","$query","$returnKey","$showDiskLoc","$natural"],r=["ObjectId","Code","BinData","DBRef","Timestamp","NumberLong","NumberDecimal","MaxKey","MinKey","RegExp","ISODate","UUID"];n=n.map(function(i){return i.replace("$","\\$")});var s="(?:"+n.join("|")+")\\b";t.languages.mongodb=t.languages.extend("javascript",{}),t.languages.insertBefore("mongodb","string",{property:{pattern:/(?:(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)(?=\s*:)/,greedy:!0,inside:{keyword:RegExp(`^(['"])?`+s+"(?:\\1)?$")}}}),t.languages.mongodb.string.inside={url:{pattern:/https?:\/\/[-\w@:%.+~#=]{1,256}\.[a-z0-9()]{1,6}\b[-\w()@:%+.~#?&/=]*/i,greedy:!0},entity:{pattern:/\b(?:(?:[01]?\d\d?|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d\d?|2[0-4]\d|25[0-5])\b/,greedy:!0}},t.languages.insertBefore("mongodb","constant",{builtin:{pattern:RegExp("\\b(?:"+r.join("|")+")\\b"),alias:"keyword"}})})(e)}ph.displayName="monkey";ph.aliases=[];function ph(e){e.languages.monkey={comment:{pattern:/^#Rem\s[\s\S]*?^#End|'.+/im,greedy:!0},string:{pattern:/"[^"\r\n]*"/,greedy:!0},preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,greedy:!0,alias:"property"},function:/\b\w+(?=\()/,"type-char":{pattern:/\b[?%#$]/,alias:"class-name"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}}fh.displayName="moonscript";fh.aliases=["moon"];function fh(e){e.languages.moonscript={comment:/--.*/,string:[{pattern:/'[^']*'|\[(=*)\[[\s\S]*?\]\1\]/,greedy:!0},{pattern:/"[^"]*"/,greedy:!0,inside:{interpolation:{pattern:/#\{[^{}]*\}/,inside:{moonscript:{pattern:/(^#\{)[\s\S]+(?=\})/,lookbehind:!0,inside:null},"interpolation-punctuation":{pattern:/#\{|\}/,alias:"punctuation"}}}}}],"class-name":[{pattern:/(\b(?:class|extends)[ \t]+)\w+/,lookbehind:!0},/\b[A-Z]\w*/],keyword:/\b(?:class|continue|do|else|elseif|export|extends|for|from|if|import|in|local|nil|return|self|super|switch|then|unless|using|when|while|with)\b/,variable:/@@?\w*/,property:{pattern:/\b(?!\d)\w+(?=:)|(:)(?!\d)\w+/,lookbehind:!0},function:{pattern:/\b(?:_G|_VERSION|assert|collectgarbage|coroutine\.(?:create|resume|running|status|wrap|yield)|debug\.(?:debug|getfenv|gethook|getinfo|getlocal|getmetatable|getregistry|getupvalue|setfenv|sethook|setlocal|setmetatable|setupvalue|traceback)|dofile|error|getfenv|getmetatable|io\.(?:close|flush|input|lines|open|output|popen|read|stderr|stdin|stdout|tmpfile|type|write)|ipairs|load|loadfile|loadstring|math\.(?:abs|acos|asin|atan|atan2|ceil|cos|cosh|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pi|pow|rad|random|randomseed|sin|sinh|sqrt|tan|tanh)|module|next|os\.(?:clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\.(?:cpath|loaded|loadlib|path|preload|seeall)|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|string\.(?:byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\.(?:concat|insert|maxn|remove|sort)|tonumber|tostring|type|unpack|xpcall)\b/,inside:{punctuation:/\./}},boolean:/\b(?:false|true)\b/,number:/(?:\B\.\d+|\b\d+\.\d+|\b\d+(?=[eE]))(?:[eE][-+]?\d+)?\b|\b(?:0x[a-fA-F\d]+|\d+)(?:U?LL)?\b/,operator:/\.{3}|[-=]>|~=|(?:[-+*/%<>!=]|\.\.)=?|[:#^]|\b(?:and|or)\b=?|\b(?:not)\b/,punctuation:/[.,()[\]{}\\]/},e.languages.moonscript.string[1].inside.interpolation.inside.moonscript.inside=e.languages.moonscript,e.languages.moon=e.languages.moonscript}mh.displayName="n1ql";mh.aliases=[];function mh(e){e.languages.n1ql={comment:{pattern:/\/\*[\s\S]*?(?:$|\*\/)|--.*/,greedy:!0},string:{pattern:/(["'])(?:\\[\s\S]|(?!\1)[^\\]|\1\1)*\1/,greedy:!0},identifier:{pattern:/`(?:\\[\s\S]|[^\\`]|``)*`/,greedy:!0},parameter:/\$[\w.]+/,keyword:/\b(?:ADVISE|ALL|ALTER|ANALYZE|AS|ASC|AT|BEGIN|BINARY|BOOLEAN|BREAK|BUCKET|BUILD|BY|CALL|CAST|CLUSTER|COLLATE|COLLECTION|COMMIT|COMMITTED|CONNECT|CONTINUE|CORRELATE|CORRELATED|COVER|CREATE|CURRENT|DATABASE|DATASET|DATASTORE|DECLARE|DECREMENT|DELETE|DERIVED|DESC|DESCRIBE|DISTINCT|DO|DROP|EACH|ELEMENT|EXCEPT|EXCLUDE|EXECUTE|EXPLAIN|FETCH|FILTER|FLATTEN|FLUSH|FOLLOWING|FOR|FORCE|FROM|FTS|FUNCTION|GOLANG|GRANT|GROUP|GROUPS|GSI|HASH|HAVING|IF|IGNORE|ILIKE|INCLUDE|INCREMENT|INDEX|INFER|INLINE|INNER|INSERT|INTERSECT|INTO|IS|ISOLATION|JAVASCRIPT|JOIN|KEY|KEYS|KEYSPACE|KNOWN|LANGUAGE|LAST|LEFT|LET|LETTING|LEVEL|LIMIT|LSM|MAP|MAPPING|MATCHED|MATERIALIZED|MERGE|MINUS|MISSING|NAMESPACE|NEST|NL|NO|NTH_VALUE|NULL|NULLS|NUMBER|OBJECT|OFFSET|ON|OPTION|OPTIONS|ORDER|OTHERS|OUTER|OVER|PARSE|PARTITION|PASSWORD|PATH|POOL|PRECEDING|PREPARE|PRIMARY|PRIVATE|PRIVILEGE|PROBE|PROCEDURE|PUBLIC|RANGE|RAW|REALM|REDUCE|RENAME|RESPECT|RETURN|RETURNING|REVOKE|RIGHT|ROLE|ROLLBACK|ROW|ROWS|SATISFIES|SAVEPOINT|SCHEMA|SCOPE|SELECT|SELF|SEMI|SET|SHOW|SOME|START|STATISTICS|STRING|SYSTEM|TIES|TO|TRAN|TRANSACTION|TRIGGER|TRUNCATE|UNBOUNDED|UNDER|UNION|UNIQUE|UNKNOWN|UNNEST|UNSET|UPDATE|UPSERT|USE|USER|USING|VALIDATE|VALUE|VALUES|VIA|VIEW|WHERE|WHILE|WINDOW|WITH|WORK|XOR)\b/i,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:FALSE|TRUE)\b/i,number:/(?:\b\d+\.|\B\.)\d+e[+\-]?\d+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i,operator:/[-+*\/%]|!=|==?|\|\||<[>=]?|>=?|\b(?:AND|ANY|ARRAY|BETWEEN|CASE|ELSE|END|EVERY|EXISTS|FIRST|IN|LIKE|NOT|OR|THEN|VALUED|WHEN|WITHIN)\b/i,punctuation:/[;[\](),.{}:]/}}hh.displayName="nand2tetris-hdl";hh.aliases=[];function hh(e){e.languages["nand2tetris-hdl"]={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,keyword:/\b(?:BUILTIN|CHIP|CLOCKED|IN|OUT|PARTS)\b/,boolean:/\b(?:false|true)\b/,function:/\b[A-Za-z][A-Za-z0-9]*(?=\()/,number:/\b\d+\b/,operator:/=|\.\./,punctuation:/[{}[\];(),:]/}}gh.displayName="naniscript";gh.aliases=["nani"];function gh(e){(function(t){var n=/\{[^\r\n\[\]{}]*\}/,r={"quoted-string":{pattern:/"(?:[^"\\]|\\.)*"/,alias:"operator"},"command-param-id":{pattern:/(\s)\w+:/,lookbehind:!0,alias:"property"},"command-param-value":[{pattern:n,alias:"selector"},{pattern:/([\t ])\S+/,lookbehind:!0,greedy:!0,alias:"operator"},{pattern:/\S(?:.*\S)?/,alias:"operator"}]};t.languages.naniscript={comment:{pattern:/^([\t ]*);.*/m,lookbehind:!0},define:{pattern:/^>.+/m,alias:"tag",inside:{value:{pattern:/(^>\w+[\t ]+)(?!\s)[^{}\r\n]+/,lookbehind:!0,alias:"operator"},key:{pattern:/(^>)\w+/,lookbehind:!0}}},label:{pattern:/^([\t ]*)#[\t ]*\w+[\t ]*$/m,lookbehind:!0,alias:"regex"},command:{pattern:/^([\t ]*)@\w+(?=[\t ]|$).*/m,lookbehind:!0,alias:"function",inside:{"command-name":/^@\w+/,expression:{pattern:n,greedy:!0,alias:"selector"},"command-params":{pattern:/\s*\S[\s\S]*/,inside:r}}},"generic-text":{pattern:/(^[ \t]*)[^#@>;\s].*/m,lookbehind:!0,alias:"punctuation",inside:{"escaped-char":/\\[{}\[\]"]/,expression:{pattern:n,greedy:!0,alias:"selector"},"inline-command":{pattern:/\[[\t ]*\w[^\r\n\[\]]*\]/,greedy:!0,alias:"function",inside:{"command-params":{pattern:/(^\[[\t ]*\w+\b)[\s\S]+(?=\]$)/,lookbehind:!0,inside:r},"command-param-name":{pattern:/^(\[[\t ]*)\w+/,lookbehind:!0,alias:"name"},"start-stop-char":/[\[\]]/}}}}},t.languages.nani=t.languages.naniscript,t.hooks.add("after-tokenize",function(o){var l=o.tokens;l.forEach(function(u){if(typeof u!="string"&&u.type==="generic-text"){var c=i(u);s(c)||(u.type="bad-line",u.content=c)}})});function s(o){for(var l="[]{}",u=[],c=0;c<o.length;c++){var d=o[c],p=l.indexOf(d);if(p!==-1){if(p%2===0)u.push(p+1);else if(u.pop()!==p)return!1}}return u.length===0}function i(o){return typeof o=="string"?o:Array.isArray(o)?o.map(i).join(""):i(o.content)}})(e)}bh.displayName="nasm";bh.aliases=[];function bh(e){e.languages.nasm={comment:/;.*$/m,string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,label:{pattern:/(^\s*)[A-Za-z._?$][\w.?$@~#]*:/m,lookbehind:!0,alias:"function"},keyword:[/\[?BITS (?:16|32|64)\]?/,{pattern:/(^\s*)section\s*[a-z.]+:?/im,lookbehind:!0},/(?:extern|global)[^;\r\n]*/i,/(?:CPU|DEFAULT|FLOAT).*$/m],register:{pattern:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|di|si|sp)|[cdefgs]s)\b/i,alias:"variable"},number:/(?:\b|(?=\$))(?:0[hx](?:\.[\da-f]+|[\da-f]+(?:\.[\da-f]+)?)(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-\/%<>=&|$!]/}}xh.displayName="neon";xh.aliases=[];function xh(e){e.languages.neon={comment:{pattern:/#.*/,greedy:!0},datetime:{pattern:/(^|[[{(=:,\s])\d\d\d\d-\d\d?-\d\d?(?:(?:[Tt]| +)\d\d?:\d\d:\d\d(?:\.\d*)? *(?:Z|[-+]\d\d?(?::?\d\d)?)?)?(?=$|[\]}),\s])/,lookbehind:!0,alias:"number"},key:{pattern:/(^|[[{(,\s])[^,:=[\]{}()'"\s]+(?=\s*:(?:$|[\]}),\s])|\s*=)/,lookbehind:!0,alias:"property"},number:{pattern:/(^|[[{(=:,\s])[+-]?(?:0x[\da-fA-F]+|0o[0-7]+|0b[01]+|(?:\d+(?:\.\d*)?|\.?\d+)(?:[eE][+-]?\d+)?)(?=$|[\]}),:=\s])/,lookbehind:!0},boolean:{pattern:/(^|[[{(=:,\s])(?:false|no|true|yes)(?=$|[\]}),:=\s])/i,lookbehind:!0},null:{pattern:/(^|[[{(=:,\s])(?:null)(?=$|[\]}),:=\s])/i,lookbehind:!0,alias:"keyword"},string:{pattern:/(^|[[{(=:,\s])(?:('''|""")\r?\n(?:(?:[^\r\n]|\r?\n(?![\t ]*\2))*\r?\n)?[\t ]*\2|'[^'\r\n]*'|"(?:\\.|[^\\"\r\n])*")/,lookbehind:!0,greedy:!0},literal:{pattern:/(^|[[{(=:,\s])(?:[^#"',:=[\]{}()\s`-]|[:-][^"',=[\]{}()\s])(?:[^,:=\]})(\s]|:(?![\s,\]})]|$)|[ \t]+[^#,:=\]})(\s])*/,lookbehind:!0,alias:"string"},punctuation:/[,:=[\]{}()-]/}}yh.displayName="nevod";yh.aliases=[];function yh(e){e.languages.nevod={comment:/\/\/.*|(?:\/\*[\s\S]*?(?:\*\/|$))/,string:{pattern:/(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))!?\*?/,greedy:!0,inside:{"string-attrs":/!$|!\*$|\*$/}},namespace:{pattern:/(@namespace\s+)[a-zA-Z0-9\-.]+(?=\s*\{)/,lookbehind:!0},pattern:{pattern:/(@pattern\s+)?#?[a-zA-Z0-9\-.]+(?:\s*\(\s*(?:~\s*)?[a-zA-Z0-9\-.]+\s*(?:,\s*(?:~\s*)?[a-zA-Z0-9\-.]*)*\))?(?=\s*=)/,lookbehind:!0,inside:{"pattern-name":{pattern:/^#?[a-zA-Z0-9\-.]+/,alias:"class-name"},fields:{pattern:/\(.*\)/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},punctuation:/[,()]/,operator:{pattern:/~/,alias:"field-hidden-mark"}}}}},search:{pattern:/(@search\s+|#)[a-zA-Z0-9\-.]+(?:\.\*)?(?=\s*;)/,alias:"function",lookbehind:!0},keyword:/@(?:having|inside|namespace|outside|pattern|require|search|where)\b/,"standard-pattern":{pattern:/\b(?:Alpha|AlphaNum|Any|Blank|End|LineBreak|Num|NumAlpha|Punct|Space|Start|Symbol|Word|WordBreak)\b(?:\([a-zA-Z0-9\-.,\s+]*\))?/,inside:{"standard-pattern-name":{pattern:/^[a-zA-Z0-9\-.]+/,alias:"builtin"},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},"standard-pattern-attr":{pattern:/[a-zA-Z0-9\-.]+/,alias:"builtin"},punctuation:/[,()]/}},quantifier:{pattern:/\b\d+(?:\s*\+|\s*-\s*\d+)?(?!\w)/,alias:"number"},operator:[{pattern:/=/,alias:"pattern-def"},{pattern:/&/,alias:"conjunction"},{pattern:/~/,alias:"exception"},{pattern:/\?/,alias:"optionality"},{pattern:/[[\]]/,alias:"repetition"},{pattern:/[{}]/,alias:"variation"},{pattern:/[+_]/,alias:"sequence"},{pattern:/\.{2,3}/,alias:"span"}],"field-capture":[{pattern:/([a-zA-Z0-9\-.]+\s*\()\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+(?:\s*,\s*[a-zA-Z0-9\-.]+\s*:\s*[a-zA-Z0-9\-.]+)*(?=\s*\))/,lookbehind:!0,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}},{pattern:/[a-zA-Z0-9\-.]+\s*:/,inside:{"field-name":{pattern:/[a-zA-Z0-9\-.]+/,alias:"variable"},colon:/:/}}],punctuation:/[:;,()]/,name:/[a-zA-Z0-9\-.]+/}}Eh.displayName="nginx";Eh.aliases=[];function Eh(e){(function(t){var n=/\$(?:\w[a-z\d]*(?:_[^\x00-\x1F\s"'\\()$]*)?|\{[^}\s"'\\]+\})/i;t.languages.nginx={comment:{pattern:/(^|[\s{};])#.*/,lookbehind:!0,greedy:!0},directive:{pattern:/(^|\s)\w(?:[^;{}"'\\\s]|\\.|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\s+(?:#.*(?!.)|(?![#\s])))*?(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:{string:{pattern:/((?:^|[^\\])(?:\\\\)*)(?:"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*')/,lookbehind:!0,greedy:!0,inside:{escape:{pattern:/\\["'\\nrt]/,alias:"entity"},variable:n}},comment:{pattern:/(\s)#.*/,lookbehind:!0,greedy:!0},keyword:{pattern:/^\S+/,greedy:!0},boolean:{pattern:/(\s)(?:off|on)(?!\S)/,lookbehind:!0},number:{pattern:/(\s)\d+[a-z]*(?!\S)/i,lookbehind:!0},variable:n}},punctuation:/[{};]/}})(e)}Sh.displayName="nim";Sh.aliases=[];function Sh(e){e.languages.nim={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(?:\b(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+)?(?:"""[\s\S]*?"""(?!")|"(?:\\[\s\S]|""|[^"\\])*")/,greedy:!0},char:{pattern:/'(?:\\(?:\d+|x[\da-fA-F]{0,2}|.)|[^'])'/,greedy:!0},function:{pattern:/(?:(?!\d)(?:\w|\\x[89a-fA-F][0-9a-fA-F])+|`[^`\r\n]+`)\*?(?:\[[^\]]+\])?(?=\s*\()/,greedy:!0,inside:{operator:/\*$/}},identifier:{pattern:/`[^`\r\n]+`/,greedy:!0,inside:{punctuation:/`/}},number:/\b(?:0[xXoObB][\da-fA-F_]+|\d[\d_]*(?:(?!\.\.)\.[\d_]*)?(?:[eE][+-]?\d[\d_]*)?)(?:'?[iuf]\d*)?/,keyword:/\b(?:addr|as|asm|atomic|bind|block|break|case|cast|concept|const|continue|converter|defer|discard|distinct|do|elif|else|end|enum|except|export|finally|for|from|func|generic|if|import|include|interface|iterator|let|macro|method|mixin|nil|object|out|proc|ptr|raise|ref|return|static|template|try|tuple|type|using|var|when|while|with|without|yield)\b/,operator:{pattern:/(^|[({\[](?=\.\.)|(?![({\[]\.).)(?:(?:[=+\-*\/<>@$~&%|!?^:\\]|\.\.|\.(?![)}\]]))+|\b(?:and|div|in|is|isnot|mod|not|notin|of|or|shl|shr|xor)\b)/m,lookbehind:!0},punctuation:/[({\[]\.|\.[)}\]]|[`(){}\[\],:]/}}Th.displayName="nix";Th.aliases=[];function Th(e){e.languages.nix={comment:{pattern:/\/\*[\s\S]*?\*\/|#.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\[\s\S])*"|''(?:(?!'')[\s\S]|''(?:'|\\|\$\{))*''/,greedy:!0,inside:{interpolation:{pattern:/(^|(?:^|(?!'').)[^\\])\$\{(?:[^{}]|\{[^}]*\})*\}/,lookbehind:!0,inside:null}}},url:[/\b(?:[a-z]{3,7}:\/\/)[\w\-+%~\/.:#=?&]+/,{pattern:/([^\/])(?:[\w\-+%~.:#=?&]*(?!\/\/)[\w\-+%~\/.:#=?&])?(?!\/\/)\/[\w\-+%~\/.:#=?&]*/,lookbehind:!0}],antiquotation:{pattern:/\$(?=\{)/,alias:"important"},number:/\b\d+\b/,keyword:/\b(?:assert|builtins|else|if|in|inherit|let|null|or|then|with)\b/,function:/\b(?:abort|add|all|any|attrNames|attrValues|baseNameOf|compareVersions|concatLists|currentSystem|deepSeq|derivation|dirOf|div|elem(?:At)?|fetch(?:Tarball|url)|filter(?:Source)?|fromJSON|genList|getAttr|getEnv|hasAttr|hashString|head|import|intersectAttrs|is(?:Attrs|Bool|Function|Int|List|Null|String)|length|lessThan|listToAttrs|map|mul|parseDrvName|pathExists|read(?:Dir|File)|removeAttrs|replaceStrings|seq|sort|stringLength|sub(?:string)?|tail|throw|to(?:File|JSON|Path|String|XML)|trace|typeOf)\b|\bfoldl'\B/,boolean:/\b(?:false|true)\b/,operator:/[=!<>]=?|\+\+?|\|\||&&|\/\/|->?|[?@]/,punctuation:/[{}()[\].,:;]/},e.languages.nix.string.inside.interpolation.inside=e.languages.nix}Nh.displayName="nsis";Nh.aliases=[];function Nh(e){e.languages.nsis={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|[#;].*)/,lookbehind:!0,greedy:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:{pattern:/(^[\t ]*)(?:Abort|Add(?:BrandingImage|Size)|AdvSplash|Allow(?:RootDirInstall|SkipFiles)|AutoCloseWindow|BG(?:Font|Gradient|Image)|Banner|BrandingText|BringToFront|CRCCheck|Call(?:InstDLL)?|Caption|ChangeUI|CheckBitmap|ClearErrors|CompletedText|ComponentText|CopyFiles|Create(?:Directory|Font|ShortCut)|Delete(?:INISec|INIStr|RegKey|RegValue)?|Detail(?:Print|sButtonText)|Dialer|Dir(?:Text|Var|Verify)|EnableWindow|Enum(?:RegKey|RegValue)|Exch|Exec(?:Shell(?:Wait)?|Wait)?|ExpandEnvStrings|File(?:BufSize|Close|ErrorText|Open|Read|ReadByte|ReadUTF16LE|ReadWord|Seek|Write|WriteByte|WriteUTF16LE|WriteWord)?|Find(?:Close|First|Next|Window)|FlushINI|Get(?:CurInstType|CurrentAddress|DLLVersion(?:Local)?|DlgItem|ErrorLevel|FileTime(?:Local)?|FullPathName|Function(?:Address|End)?|InstDirError|KnownFolderPath|LabelAddress|TempFileName|WinVer)|Goto|HideWindow|Icon|If(?:Abort|Errors|FileExists|RebootFlag|RtlLanguage|ShellVarContextAll|Silent)|InitPluginsDir|InstProgressFlags|Inst(?:Type(?:GetText|SetText)?)|Install(?:ButtonText|Colors|Dir(?:RegKey)?)|Int(?:64|Ptr)?CmpU?|Int(?:64)?Fmt|Int(?:Ptr)?Op|IsWindow|Lang(?:DLL|String)|License(?:BkColor|Data|ForceSelection|LangString|Text)|LoadLanguageFile|LockWindow|Log(?:Set|Text)|Manifest(?:DPIAware|SupportedOS)|Math|MessageBox|MiscButtonText|NSISdl|Name|Nop|OutFile|PE(?:DllCharacteristics|SubsysVer)|Page(?:Callbacks)?|Pop|Push|Quit|RMDir|Read(?:EnvStr|INIStr|RegDWORD|RegStr)|Reboot|RegDLL|Rename|RequestExecutionLevel|ReserveFile|Return|SearchPath|Section(?:End|GetFlags|GetInstTypes|GetSize|GetText|Group|In|SetFlags|SetInstTypes|SetSize|SetText)?|SendMessage|Set(?:AutoClose|BrandingImage|Compress|Compressor(?:DictSize)?|CtlColors|CurInstType|DatablockOptimize|DateSave|Details(?:Print|View)|ErrorLevel|Errors|FileAttributes|Font|OutPath|Overwrite|PluginUnload|RebootFlag|RegView|ShellVarContext|Silent)|Show(?:InstDetails|UninstDetails|Window)|Silent(?:Install|UnInstall)|Sleep|SpaceTexts|Splash|StartMenu|Str(?:CmpS?|Cpy|Len)|SubCaption|System|Target|UnRegDLL|Unicode|UninstPage|Uninstall(?:ButtonText|Caption|Icon|SubCaption|Text)|UserInfo|VI(?:AddVersionKey|FileVersion|ProductVersion)|VPatch|Var|WindowIcon|Write(?:INIStr|Reg(?:Bin|DWORD|ExpandStr|MultiStr|None|Str)|Uninstaller)|XPStyle|ns(?:Dialogs|Exec))\b/m,lookbehind:!0},property:/\b(?:ARCHIVE|FILE_(?:ATTRIBUTE_ARCHIVE|ATTRIBUTE_NORMAL|ATTRIBUTE_OFFLINE|ATTRIBUTE_READONLY|ATTRIBUTE_SYSTEM|ATTRIBUTE_TEMPORARY)|HK(?:(?:CR|CU|LM)(?:32|64)?|DD|PD|U)|HKEY_(?:CLASSES_ROOT|CURRENT_CONFIG|CURRENT_USER|DYN_DATA|LOCAL_MACHINE|PERFORMANCE_DATA|USERS)|ID(?:ABORT|CANCEL|IGNORE|NO|OK|RETRY|YES)|MB_(?:ABORTRETRYIGNORE|DEFBUTTON1|DEFBUTTON2|DEFBUTTON3|DEFBUTTON4|ICONEXCLAMATION|ICONINFORMATION|ICONQUESTION|ICONSTOP|OK|OKCANCEL|RETRYCANCEL|RIGHT|RTLREADING|SETFOREGROUND|TOPMOST|USERICON|YESNO)|NORMAL|OFFLINE|READONLY|SHCTX|SHELL_CONTEXT|SYSTEM|TEMPORARY|admin|all|auto|both|colored|false|force|hide|highest|lastused|leave|listonly|none|normal|notset|off|on|open|print|show|silent|silentlog|smooth|textonly|true|user)\b/,constant:/\$\{[!\w\.:\^-]+\}|\$\([!\w\.:\^-]+\)/,variable:/\$\w[\w\.]*/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--?|\+\+?|<=?|>=?|==?=?|&&?|\|\|?|[?*\/~^%]/,punctuation:/[{}[\];(),.:]/,important:{pattern:/(^[\t ]*)!(?:addincludedir|addplugindir|appendfile|cd|define|delfile|echo|else|endif|error|execute|finalize|getdllversion|gettlbversion|if|ifdef|ifmacrodef|ifmacrondef|ifndef|include|insertmacro|macro|macroend|makensis|packhdr|pragma|searchparse|searchreplace|system|tempfile|undef|verbose|warning)\b/im,lookbehind:!0}}}wh.displayName="ocaml";wh.aliases=[];function wh(e){e.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/}}vh.displayName="odin";vh.aliases=[];function vh(e){(function(t){var n=/\\(?:["'\\abefnrtv]|0[0-7]{2}|U[\dA-Fa-f]{6}|u[\dA-Fa-f]{4}|x[\dA-Fa-f]{2})/;t.languages.odin={comment:[{pattern:/\/\*(?:[^/*]|\/(?!\*)|\*(?!\/)|\/\*(?:\*(?!\/)|[^*])*(?:\*\/|$))*(?:\*\/|$)/,greedy:!0},{pattern:/#![^\n\r]*/,greedy:!0},{pattern:/\/\/[^\n\r]*/,greedy:!0}],char:{pattern:/'(?:\\(?:.|[0Uux][0-9A-Fa-f]{1,6})|[^\n\r'\\])'/,greedy:!0,inside:{symbol:n}},string:[{pattern:/`[^`]*`/,greedy:!0},{pattern:/"(?:\\.|[^\n\r"\\])*"/,greedy:!0,inside:{symbol:n}}],directive:{pattern:/#\w+/,alias:"property"},number:/\b0(?:b[01_]+|d[\d_]+|h_*(?:(?:(?:[\dA-Fa-f]_*){8}){1,2}|(?:[\dA-Fa-f]_*){4})|o[0-7_]+|x[\dA-F_a-f]+|z[\dAB_ab]+)\b|(?:\b\d+(?:\.(?!\.)\d*)?|\B\.\d+)(?:[Ee][+-]?\d*)?[ijk]?(?!\w)/,discard:{pattern:/\b_\b/,alias:"keyword"},"procedure-definition":{pattern:/\b\w+(?=[ \t]*(?::\s*){2}proc\b)/,alias:"function"},keyword:/\b(?:asm|auto_cast|bit_set|break|case|cast|context|continue|defer|distinct|do|dynamic|else|enum|fallthrough|for|foreign|if|import|in|map|matrix|not_in|or_else|or_return|package|proc|return|struct|switch|transmute|typeid|union|using|when|where)\b/,"procedure-name":{pattern:/\b\w+(?=[ \t]*\()/,alias:"function"},boolean:/\b(?:false|nil|true)\b/,"constant-parameter-sign":{pattern:/\$/,alias:"important"},undefined:{pattern:/---/,alias:"operator"},arrow:{pattern:/->/,alias:"punctuation"},operator:/\+\+|--|\.\.[<=]?|(?:&~|[-!*+/=~]|[%&<>|]{1,2})=?|[?^]/,punctuation:/[(),.:;@\[\]{}]/}})(e)}Ah.displayName="opencl";Ah.aliases=[];function Ah(e){e.register(Yn),(function(t){t.languages.opencl=t.languages.extend("c",{keyword:/\b(?:(?:__)?(?:constant|global|kernel|local|private|read_only|read_write|write_only)|__attribute__|auto|(?:bool|u?(?:char|int|long|short)|half|quad)(?:2|3|4|8|16)?|break|case|complex|const|continue|(?:double|float)(?:16(?:x(?:1|2|4|8|16))?|1x(?:1|2|4|8|16)|2(?:x(?:1|2|4|8|16))?|3|4(?:x(?:1|2|4|8|16))?|8(?:x(?:1|2|4|8|16))?)?|default|do|else|enum|extern|for|goto|if|imaginary|inline|packed|pipe|register|restrict|return|signed|sizeof|static|struct|switch|typedef|uniform|union|unsigned|void|volatile|while)\b/,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[fuhl]{0,4}/i,boolean:/\b(?:false|true)\b/,"constant-opencl-kernel":{pattern:/\b(?:CHAR_(?:BIT|MAX|MIN)|CLK_(?:ADDRESS_(?:CLAMP(?:_TO_EDGE)?|NONE|REPEAT)|FILTER_(?:LINEAR|NEAREST)|(?:GLOBAL|LOCAL)_MEM_FENCE|NORMALIZED_COORDS_(?:FALSE|TRUE))|CL_(?:BGRA|(?:HALF_)?FLOAT|INTENSITY|LUMINANCE|A?R?G?B?[Ax]?|(?:(?:UN)?SIGNED|[US]NORM)_(?:INT(?:8|16|32))|UNORM_(?:INT_101010|SHORT_(?:555|565)))|(?:DBL|FLT|HALF)_(?:DIG|EPSILON|(?:MAX|MIN)(?:(?:_10)?_EXP)?|MANT_DIG)|FLT_RADIX|HUGE_VALF?|(?:INT|LONG|SCHAR|SHRT)_(?:MAX|MIN)|INFINITY|MAXFLOAT|M_(?:[12]_PI|2_SQRTPI|E|LN(?:2|10)|LOG(?:2|10)E?|PI(?:_[24])?|SQRT(?:1_2|2))(?:_F|_H)?|NAN|(?:UCHAR|UINT|ULONG|USHRT)_MAX)\b/,alias:"constant"}}),t.languages.insertBefore("opencl","class-name",{"builtin-type":{pattern:/\b(?:_cl_(?:command_queue|context|device_id|event|kernel|mem|platform_id|program|sampler)|cl_(?:image_format|mem_fence_flags)|clk_event_t|event_t|image(?:1d_(?:array_|buffer_)?t|2d_(?:array_(?:depth_|msaa_depth_|msaa_)?|depth_|msaa_depth_|msaa_)?t|3d_t)|intptr_t|ndrange_t|ptrdiff_t|queue_t|reserve_id_t|sampler_t|size_t|uintptr_t)\b/,alias:"keyword"}});var n={"type-opencl-host":{pattern:/\b(?:cl_(?:GLenum|GLint|GLuin|addressing_mode|bitfield|bool|buffer_create_type|build_status|channel_(?:order|type)|(?:u?(?:char|int|long|short)|double|float)(?:2|3|4|8|16)?|command_(?:queue(?:_info|_properties)?|type)|context(?:_info|_properties)?|device_(?:exec_capabilities|fp_config|id|info|local_mem_type|mem_cache_type|type)|(?:event|sampler)(?:_info)?|filter_mode|half|image_info|kernel(?:_info|_work_group_info)?|map_flags|mem(?:_flags|_info|_object_type)?|platform_(?:id|info)|profiling_info|program(?:_build_info|_info)?))\b/,alias:"keyword"},"boolean-opencl-host":{pattern:/\bCL_(?:FALSE|TRUE)\b/,alias:"boolean"},"constant-opencl-host":{pattern:/\bCL_(?:A|ABGR|ADDRESS_(?:CLAMP(?:_TO_EDGE)?|MIRRORED_REPEAT|NONE|REPEAT)|ARGB|BGRA|BLOCKING|BUFFER_CREATE_TYPE_REGION|BUILD_(?:ERROR|IN_PROGRESS|NONE|PROGRAM_FAILURE|SUCCESS)|COMMAND_(?:ACQUIRE_GL_OBJECTS|BARRIER|COPY_(?:BUFFER(?:_RECT|_TO_IMAGE)?|IMAGE(?:_TO_BUFFER)?)|FILL_(?:BUFFER|IMAGE)|MAP(?:_BUFFER|_IMAGE)|MARKER|MIGRATE(?:_SVM)?_MEM_OBJECTS|NATIVE_KERNEL|NDRANGE_KERNEL|READ_(?:BUFFER(?:_RECT)?|IMAGE)|RELEASE_GL_OBJECTS|SVM_(?:FREE|MAP|MEMCPY|MEMFILL|UNMAP)|TASK|UNMAP_MEM_OBJECT|USER|WRITE_(?:BUFFER(?:_RECT)?|IMAGE))|COMPILER_NOT_AVAILABLE|COMPILE_PROGRAM_FAILURE|COMPLETE|CONTEXT_(?:DEVICES|INTEROP_USER_SYNC|NUM_DEVICES|PLATFORM|PROPERTIES|REFERENCE_COUNT)|DEPTH(?:_STENCIL)?|DEVICE_(?:ADDRESS_BITS|AFFINITY_DOMAIN_(?:L[1-4]_CACHE|NEXT_PARTITIONABLE|NUMA)|AVAILABLE|BUILT_IN_KERNELS|COMPILER_AVAILABLE|DOUBLE_FP_CONFIG|ENDIAN_LITTLE|ERROR_CORRECTION_SUPPORT|EXECUTION_CAPABILITIES|EXTENSIONS|GLOBAL_(?:MEM_(?:CACHELINE_SIZE|CACHE_SIZE|CACHE_TYPE|SIZE)|VARIABLE_PREFERRED_TOTAL_SIZE)|HOST_UNIFIED_MEMORY|IL_VERSION|IMAGE(?:2D_MAX_(?:HEIGHT|WIDTH)|3D_MAX_(?:DEPTH|HEIGHT|WIDTH)|_BASE_ADDRESS_ALIGNMENT|_MAX_ARRAY_SIZE|_MAX_BUFFER_SIZE|_PITCH_ALIGNMENT|_SUPPORT)|LINKER_AVAILABLE|LOCAL_MEM_SIZE|LOCAL_MEM_TYPE|MAX_(?:CLOCK_FREQUENCY|COMPUTE_UNITS|CONSTANT_ARGS|CONSTANT_BUFFER_SIZE|GLOBAL_VARIABLE_SIZE|MEM_ALLOC_SIZE|NUM_SUB_GROUPS|ON_DEVICE_(?:EVENTS|QUEUES)|PARAMETER_SIZE|PIPE_ARGS|READ_IMAGE_ARGS|READ_WRITE_IMAGE_ARGS|SAMPLERS|WORK_GROUP_SIZE|WORK_ITEM_DIMENSIONS|WORK_ITEM_SIZES|WRITE_IMAGE_ARGS)|MEM_BASE_ADDR_ALIGN|MIN_DATA_TYPE_ALIGN_SIZE|NAME|NATIVE_VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT)|NOT_(?:AVAILABLE|FOUND)|OPENCL_C_VERSION|PARENT_DEVICE|PARTITION_(?:AFFINITY_DOMAIN|BY_AFFINITY_DOMAIN|BY_COUNTS|BY_COUNTS_LIST_END|EQUALLY|FAILED|MAX_SUB_DEVICES|PROPERTIES|TYPE)|PIPE_MAX_(?:ACTIVE_RESERVATIONS|PACKET_SIZE)|PLATFORM|PREFERRED_(?:GLOBAL_ATOMIC_ALIGNMENT|INTEROP_USER_SYNC|LOCAL_ATOMIC_ALIGNMENT|PLATFORM_ATOMIC_ALIGNMENT|VECTOR_WIDTH_(?:CHAR|DOUBLE|FLOAT|HALF|INT|LONG|SHORT))|PRINTF_BUFFER_SIZE|PROFILE|PROFILING_TIMER_RESOLUTION|QUEUE_(?:ON_(?:DEVICE_(?:MAX_SIZE|PREFERRED_SIZE|PROPERTIES)|HOST_PROPERTIES)|PROPERTIES)|REFERENCE_COUNT|SINGLE_FP_CONFIG|SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS|SVM_(?:ATOMICS|CAPABILITIES|COARSE_GRAIN_BUFFER|FINE_GRAIN_BUFFER|FINE_GRAIN_SYSTEM)|TYPE(?:_ACCELERATOR|_ALL|_CPU|_CUSTOM|_DEFAULT|_GPU)?|VENDOR(?:_ID)?|VERSION)|DRIVER_VERSION|EVENT_(?:COMMAND_(?:EXECUTION_STATUS|QUEUE|TYPE)|CONTEXT|REFERENCE_COUNT)|EXEC_(?:KERNEL|NATIVE_KERNEL|STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST)|FILTER_(?:LINEAR|NEAREST)|FLOAT|FP_(?:CORRECTLY_ROUNDED_DIVIDE_SQRT|DENORM|FMA|INF_NAN|ROUND_TO_INF|ROUND_TO_NEAREST|ROUND_TO_ZERO|SOFT_FLOAT)|GLOBAL|HALF_FLOAT|IMAGE_(?:ARRAY_SIZE|BUFFER|DEPTH|ELEMENT_SIZE|FORMAT|FORMAT_MISMATCH|FORMAT_NOT_SUPPORTED|HEIGHT|NUM_MIP_LEVELS|NUM_SAMPLES|ROW_PITCH|SLICE_PITCH|WIDTH)|INTENSITY|INVALID_(?:ARG_INDEX|ARG_SIZE|ARG_VALUE|BINARY|BUFFER_SIZE|BUILD_OPTIONS|COMMAND_QUEUE|COMPILER_OPTIONS|CONTEXT|DEVICE|DEVICE_PARTITION_COUNT|DEVICE_QUEUE|DEVICE_TYPE|EVENT|EVENT_WAIT_LIST|GLOBAL_OFFSET|GLOBAL_WORK_SIZE|GL_OBJECT|HOST_PTR|IMAGE_DESCRIPTOR|IMAGE_FORMAT_DESCRIPTOR|IMAGE_SIZE|KERNEL|KERNEL_ARGS|KERNEL_DEFINITION|KERNEL_NAME|LINKER_OPTIONS|MEM_OBJECT|MIP_LEVEL|OPERATION|PIPE_SIZE|PLATFORM|PROGRAM|PROGRAM_EXECUTABLE|PROPERTY|QUEUE_PROPERTIES|SAMPLER|VALUE|WORK_DIMENSION|WORK_GROUP_SIZE|WORK_ITEM_SIZE)|KERNEL_(?:ARG_(?:ACCESS_(?:NONE|QUALIFIER|READ_ONLY|READ_WRITE|WRITE_ONLY)|ADDRESS_(?:CONSTANT|GLOBAL|LOCAL|PRIVATE|QUALIFIER)|INFO_NOT_AVAILABLE|NAME|TYPE_(?:CONST|NAME|NONE|PIPE|QUALIFIER|RESTRICT|VOLATILE))|ATTRIBUTES|COMPILE_NUM_SUB_GROUPS|COMPILE_WORK_GROUP_SIZE|CONTEXT|EXEC_INFO_SVM_FINE_GRAIN_SYSTEM|EXEC_INFO_SVM_PTRS|FUNCTION_NAME|GLOBAL_WORK_SIZE|LOCAL_MEM_SIZE|LOCAL_SIZE_FOR_SUB_GROUP_COUNT|MAX_NUM_SUB_GROUPS|MAX_SUB_GROUP_SIZE_FOR_NDRANGE|NUM_ARGS|PREFERRED_WORK_GROUP_SIZE_MULTIPLE|PRIVATE_MEM_SIZE|PROGRAM|REFERENCE_COUNT|SUB_GROUP_COUNT_FOR_NDRANGE|WORK_GROUP_SIZE)|LINKER_NOT_AVAILABLE|LINK_PROGRAM_FAILURE|LOCAL|LUMINANCE|MAP_(?:FAILURE|READ|WRITE|WRITE_INVALIDATE_REGION)|MEM_(?:ALLOC_HOST_PTR|ASSOCIATED_MEMOBJECT|CONTEXT|COPY_HOST_PTR|COPY_OVERLAP|FLAGS|HOST_NO_ACCESS|HOST_PTR|HOST_READ_ONLY|HOST_WRITE_ONLY|KERNEL_READ_AND_WRITE|MAP_COUNT|OBJECT_(?:ALLOCATION_FAILURE|BUFFER|IMAGE1D|IMAGE1D_ARRAY|IMAGE1D_BUFFER|IMAGE2D|IMAGE2D_ARRAY|IMAGE3D|PIPE)|OFFSET|READ_ONLY|READ_WRITE|REFERENCE_COUNT|SIZE|SVM_ATOMICS|SVM_FINE_GRAIN_BUFFER|TYPE|USES_SVM_POINTER|USE_HOST_PTR|WRITE_ONLY)|MIGRATE_MEM_OBJECT_(?:CONTENT_UNDEFINED|HOST)|MISALIGNED_SUB_BUFFER_OFFSET|NONE|NON_BLOCKING|OUT_OF_(?:HOST_MEMORY|RESOURCES)|PIPE_(?:MAX_PACKETS|PACKET_SIZE)|PLATFORM_(?:EXTENSIONS|HOST_TIMER_RESOLUTION|NAME|PROFILE|VENDOR|VERSION)|PROFILING_(?:COMMAND_(?:COMPLETE|END|QUEUED|START|SUBMIT)|INFO_NOT_AVAILABLE)|PROGRAM_(?:BINARIES|BINARY_SIZES|BINARY_TYPE(?:_COMPILED_OBJECT|_EXECUTABLE|_LIBRARY|_NONE)?|BUILD_(?:GLOBAL_VARIABLE_TOTAL_SIZE|LOG|OPTIONS|STATUS)|CONTEXT|DEVICES|IL|KERNEL_NAMES|NUM_DEVICES|NUM_KERNELS|REFERENCE_COUNT|SOURCE)|QUEUED|QUEUE_(?:CONTEXT|DEVICE|DEVICE_DEFAULT|ON_DEVICE|ON_DEVICE_DEFAULT|OUT_OF_ORDER_EXEC_MODE_ENABLE|PROFILING_ENABLE|PROPERTIES|REFERENCE_COUNT|SIZE)|R|RA|READ_(?:ONLY|WRITE)_CACHE|RG|RGB|RGBA|RGBx|RGx|RUNNING|Rx|SAMPLER_(?:ADDRESSING_MODE|CONTEXT|FILTER_MODE|LOD_MAX|LOD_MIN|MIP_FILTER_MODE|NORMALIZED_COORDS|REFERENCE_COUNT)|(?:UN)?SIGNED_INT(?:8|16|32)|SNORM_INT(?:8|16)|SUBMITTED|SUCCESS|UNORM_INT(?:8|16|24|_101010|_101010_2)|UNORM_SHORT_(?:555|565)|VERSION_(?:1_0|1_1|1_2|2_0|2_1)|sBGRA|sRGB|sRGBA|sRGBx)\b/,alias:"constant"},"function-opencl-host":{pattern:/\bcl(?:BuildProgram|CloneKernel|CompileProgram|Create(?:Buffer|CommandQueue(?:WithProperties)?|Context|ContextFromType|Image|Image2D|Image3D|Kernel|KernelsInProgram|Pipe|ProgramWith(?:Binary|BuiltInKernels|IL|Source)|Sampler|SamplerWithProperties|SubBuffer|SubDevices|UserEvent)|Enqueue(?:(?:Barrier|Marker)(?:WithWaitList)?|Copy(?:Buffer(?:Rect|ToImage)?|Image(?:ToBuffer)?)|(?:Fill|Map)(?:Buffer|Image)|MigrateMemObjects|NDRangeKernel|NativeKernel|(?:Read|Write)(?:Buffer(?:Rect)?|Image)|SVM(?:Free|Map|MemFill|Memcpy|MigrateMem|Unmap)|Task|UnmapMemObject|WaitForEvents)|Finish|Flush|Get(?:CommandQueueInfo|ContextInfo|Device(?:AndHostTimer|IDs|Info)|Event(?:Profiling)?Info|ExtensionFunctionAddress(?:ForPlatform)?|HostTimer|ImageInfo|Kernel(?:ArgInfo|Info|SubGroupInfo|WorkGroupInfo)|MemObjectInfo|PipeInfo|Platform(?:IDs|Info)|Program(?:Build)?Info|SamplerInfo|SupportedImageFormats)|LinkProgram|(?:Release|Retain)(?:CommandQueue|Context|Device|Event|Kernel|MemObject|Program|Sampler)|SVM(?:Alloc|Free)|Set(?:CommandQueueProperty|DefaultDeviceCommandQueue|EventCallback|Kernel|Kernel(?:Arg(?:SVMPointer)?|ExecInfo)|MemObjectDestructorCallback|UserEventStatus)|Unload(?:Platform)?Compiler|WaitForEvents)\b/,alias:"function"}};t.languages.insertBefore("c","keyword",n),t.languages.cpp&&(n["type-opencl-host-cpp"]={pattern:/\b(?:Buffer|BufferGL|BufferRenderGL|CommandQueue|Context|Device|DeviceCommandQueue|EnqueueArgs|Event|Image|Image1D|Image1DArray|Image1DBuffer|Image2D|Image2DArray|Image2DGL|Image3D|Image3DGL|ImageFormat|ImageGL|Kernel|KernelFunctor|LocalSpaceArg|Memory|NDRange|Pipe|Platform|Program|SVMAllocator|SVMTraitAtomic|SVMTraitCoarse|SVMTraitFine|SVMTraitReadOnly|SVMTraitReadWrite|SVMTraitWriteOnly|Sampler|UserEvent)\b/,alias:"keyword"},t.languages.insertBefore("cpp","keyword",n))})(e)}kh.displayName="openqasm";kh.aliases=["qasm"];function kh(e){e.languages.openqasm={comment:/\/\*[\s\S]*?\*\/|\/\/.*/,string:{pattern:/"[^"\r\n\t]*"|'[^'\r\n\t]*'/,greedy:!0},keyword:/\b(?:CX|OPENQASM|U|barrier|boxas|boxto|break|const|continue|ctrl|def|defcal|defcalgrammar|delay|else|end|for|gate|gphase|if|in|include|inv|kernel|lengthof|let|measure|pow|reset|return|rotary|stretchinf|while)\b|#pragma\b/,"class-name":/\b(?:angle|bit|bool|creg|fixed|float|int|length|qreg|qubit|stretch|uint)\b/,function:/\b(?:cos|exp|ln|popcount|rotl|rotr|sin|sqrt|tan)\b(?=\s*\()/,constant:/\b(?:euler|pi|tau)\b|π|𝜏|ℇ/,number:{pattern:/(^|[^.\w$])(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?(?:dt|ns|us|µs|ms|s)?/i,lookbehind:!0},operator:/->|>>=?|<<=?|&&|\|\||\+\+|--|[!=<>&|~^+\-*/%]=?|@/,punctuation:/[(){}\[\];,:.]/},e.languages.qasm=e.languages.openqasm}_h.displayName="oz";_h.aliases=[];function _h(e){e.languages.oz={comment:{pattern:/\/\*[\s\S]*?\*\/|%.*/,greedy:!0},string:{pattern:/"(?:[^"\\]|\\[\s\S])*"/,greedy:!0},atom:{pattern:/'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,alias:"builtin"},keyword:/\$|\[\]|\b(?:_|at|attr|case|catch|choice|class|cond|declare|define|dis|else(?:case|if)?|end|export|fail|false|feat|finally|from|fun|functor|if|import|in|local|lock|meth|nil|not|of|or|prepare|proc|prop|raise|require|self|skip|then|thread|true|try|unit)\b/,function:[/\b[a-z][A-Za-z\d]*(?=\()/,{pattern:/(\{)[A-Z][A-Za-z\d]*\b/,lookbehind:!0}],number:/\b(?:0[bx][\da-f]+|\d+(?:\.\d*)?(?:e~?\d+)?)\b|&(?:[^\\]|\\(?:\d{3}|.))/i,variable:/`(?:[^`\\]|\\.)+`/,"attr-name":/\b\w+(?=[ \t]*:(?![:=]))/,operator:/:(?:=|::?)|<[-:=]?|=(?:=|<?:?)|>=?:?|\\=:?|!!?|[|#+\-*\/,~^@]|\b(?:andthen|div|mod|orelse)\b/,punctuation:/[\[\](){}.:;?]/}}Ch.displayName="parigp";Ch.aliases=[];function Ch(e){e.languages.parigp={comment:/\/\*[\s\S]*?\*\/|\\\\.*/,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"/,greedy:!0},keyword:(function(){var t=["breakpoint","break","dbg_down","dbg_err","dbg_up","dbg_x","forcomposite","fordiv","forell","forpart","forprime","forstep","forsubgroup","forvec","for","iferr","if","local","my","next","return","until","while"];return t=t.map(function(n){return n.split("").join(" *")}).join("|"),RegExp("\\b(?:"+t+")\\b")})(),function:/\b\w(?:[\w ]*\w)?(?= *\()/,number:{pattern:/((?:\. *\. *)?)(?:\b\d(?: *\d)*(?: *(?!\. *\.)\.(?: *\d)*)?|\. *\d(?: *\d)*)(?: *e *(?:[+-] *)?\d(?: *\d)*)?/i,lookbehind:!0},operator:/\. *\.|[*\/!](?: *=)?|%(?: *=|(?: *#)?(?: *')*)?|\+(?: *[+=])?|-(?: *[-=>])?|<(?: *>|(?: *<)?(?: *=)?)?|>(?: *>)?(?: *=)?|=(?: *=){0,2}|\\(?: *\/)?(?: *=)?|&(?: *&)?|\| *\||['#~^]/,punctuation:/[\[\]{}().,:;|]/}}Ih.displayName="parser";Ih.aliases=[];function Ih(e){e.register(rn),(function(t){var n=t.languages.parser=t.languages.extend("markup",{keyword:{pattern:/(^|[^^])(?:\^(?:case|eval|for|if|switch|throw)\b|@(?:BASE|CLASS|GET(?:_DEFAULT)?|OPTIONS|SET_DEFAULT|USE)\b)/,lookbehind:!0},variable:{pattern:/(^|[^^])\B\$(?:\w+|(?=[.{]))(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{punctuation:/\.|:+/}},function:{pattern:/(^|[^^])\B[@^]\w+(?:(?:\.|::?)\w+)*(?:\.|::?)?/,lookbehind:!0,inside:{keyword:{pattern:/(^@)(?:GET_|SET_)/,lookbehind:!0},punctuation:/\.|:+/}},escape:{pattern:/\^(?:[$^;@()\[\]{}"':]|#[a-f\d]*)/i,alias:"builtin"},punctuation:/[\[\](){};]/});n=t.languages.insertBefore("parser","keyword",{"parser-comment":{pattern:/(\s)#.*/,lookbehind:!0,alias:"comment"},expression:{pattern:/(^|[^^])\((?:[^()]|\((?:[^()]|\((?:[^()])*\))*\))*\)/,greedy:!0,lookbehind:!0,inside:{string:{pattern:/(^|[^^])(["'])(?:(?!\2)[^^]|\^[\s\S])*\2/,lookbehind:!0},keyword:n.keyword,variable:n.variable,function:n.function,boolean:/\b(?:false|true)\b/,number:/\b(?:0x[a-f\d]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?)\b/i,escape:n.escape,operator:/[~+*\/\\%]|!(?:\|\|?|=)?|&&?|\|\|?|==|<[<=]?|>[>=]?|-[fd]?|\b(?:def|eq|ge|gt|in|is|le|lt|ne)\b/,punctuation:n.punctuation}}}),t.languages.insertBefore("inside","punctuation",{expression:n.expression,keyword:n.keyword,variable:n.variable,function:n.function,escape:n.escape,"parser-punctuation":{pattern:n.punctuation,alias:"punctuation"}},n.tag.inside["attr-value"])})(e)}Rh.displayName="pascal";Rh.aliases=["objectpascal"];function Rh(e){e.languages.pascal={directive:{pattern:/\{\$[\s\S]*?\}/,greedy:!0,alias:["marco","property"]},comment:{pattern:/\(\*[\s\S]*?\*\)|\{[\s\S]*?\}|\/\/.*/,greedy:!0},string:{pattern:/(?:'(?:''|[^'\r\n])*'(?!')|#[&$%]?[a-f\d]+)+|\^[a-z]/i,greedy:!0},asm:{pattern:/(\basm\b)[\s\S]+?(?=\bend\s*[;[])/i,lookbehind:!0,greedy:!0,inside:null},keyword:[{pattern:/(^|[^&])\b(?:absolute|array|asm|begin|case|const|constructor|destructor|do|downto|else|end|file|for|function|goto|if|implementation|inherited|inline|interface|label|nil|object|of|operator|packed|procedure|program|record|reintroduce|repeat|self|set|string|then|to|type|unit|until|uses|var|while|with)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:dispose|exit|false|new|true)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:class|dispinterface|except|exports|finalization|finally|initialization|inline|library|on|out|packed|property|raise|resourcestring|threadvar|try)\b/i,lookbehind:!0},{pattern:/(^|[^&])\b(?:absolute|abstract|alias|assembler|bitpacked|break|cdecl|continue|cppdecl|cvar|default|deprecated|dynamic|enumerator|experimental|export|external|far|far16|forward|generic|helper|implements|index|interrupt|iochecks|local|message|name|near|nodefault|noreturn|nostackframe|oldfpccall|otherwise|overload|override|pascal|platform|private|protected|public|published|read|register|reintroduce|result|safecall|saveregisters|softfloat|specialize|static|stdcall|stored|strict|unaligned|unimplemented|varargs|virtual|write)\b/i,lookbehind:!0}],number:[/(?:[&%]\d+|\$[a-f\d]+)/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?/i],operator:[/\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=]/,{pattern:/(^|[^&])\b(?:and|as|div|exclude|in|include|is|mod|not|or|shl|shr|xor)\b/,lookbehind:!0}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/},e.languages.pascal.asm.inside=e.languages.extend("pascal",{asm:void 0,keyword:void 0,operator:void 0}),e.languages.objectpascal=e.languages.pascal}Dh.displayName="pascaligo";Dh.aliases=[];function Dh(e){(function(t){var n=/\((?:[^()]|\((?:[^()]|\([^()]*\))*\))*\)/.source,r=/(?:\b\w+(?:<braces>)?|<braces>)/.source.replace(/<braces>/g,function(){return n}),s=t.languages.pascaligo={comment:/\(\*[\s\S]+?\*\)|\/\/.*/,string:{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\^[a-z]/i,greedy:!0},"class-name":[{pattern:RegExp(/(\btype\s+\w+\s+is\s+)<type>/.source.replace(/<type>/g,function(){return r}),"i"),lookbehind:!0,inside:null},{pattern:RegExp(/<type>(?=\s+is\b)/.source.replace(/<type>/g,function(){return r}),"i"),inside:null},{pattern:RegExp(/(:\s*)<type>/.source.replace(/<type>/g,function(){return r})),lookbehind:!0,inside:null}],keyword:{pattern:/(^|[^&])\b(?:begin|block|case|const|else|end|fail|for|from|function|if|is|nil|of|remove|return|skip|then|type|var|while|with)\b/i,lookbehind:!0},boolean:{pattern:/(^|[^&])\b(?:False|True)\b/i,lookbehind:!0},builtin:{pattern:/(^|[^&])\b(?:bool|int|list|map|nat|record|string|unit)\b/i,lookbehind:!0},function:/\b\w+(?=\s*\()/,number:[/%[01]+|&[0-7]+|\$[a-f\d]+/i,/\b\d+(?:\.\d+)?(?:e[+-]?\d+)?(?:mtz|n)?/i],operator:/->|=\/=|\.\.|\*\*|:=|<[<=>]?|>[>=]?|[+\-*\/]=?|[@^=|]|\b(?:and|mod|or)\b/,punctuation:/\(\.|\.\)|[()\[\]:;,.{}]/},i=["comment","keyword","builtin","operator","punctuation"].reduce(function(o,l){return o[l]=s[l],o},{});s["class-name"].forEach(function(o){o.inside=i})})(e)}Oh.displayName="psl";Oh.aliases=[];function Oh(e){e.languages.psl={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0,inside:{symbol:/\\[ntrbA-Z"\\]/}},"heredoc-string":{pattern:/<<<([a-zA-Z_]\w*)[\r\n](?:.*[\r\n])*?\1\b/,alias:"string",greedy:!0},keyword:/\b(?:__multi|__single|case|default|do|else|elsif|exit|export|for|foreach|function|if|last|line|local|next|requires|return|switch|until|while|word)\b/,constant:/\b(?:ALARM|CHART_ADD_GRAPH|CHART_DELETE_GRAPH|CHART_DESTROY|CHART_LOAD|CHART_PRINT|EOF|OFFLINE|OK|PSL_PROF_LOG|R_CHECK_HORIZ|R_CHECK_VERT|R_CLICKER|R_COLUMN|R_FRAME|R_ICON|R_LABEL|R_LABEL_CENTER|R_LIST_MULTIPLE|R_LIST_MULTIPLE_ND|R_LIST_SINGLE|R_LIST_SINGLE_ND|R_MENU|R_POPUP|R_POPUP_SCROLLED|R_RADIO_HORIZ|R_RADIO_VERT|R_ROW|R_SCALE_HORIZ|R_SCALE_VERT|R_SEP_HORIZ|R_SEP_VERT|R_SPINNER|R_TEXT_FIELD|R_TEXT_FIELD_LABEL|R_TOGGLE|TRIM_LEADING|TRIM_LEADING_AND_TRAILING|TRIM_REDUNDANT|TRIM_TRAILING|VOID|WARN)\b/,boolean:/\b(?:FALSE|False|NO|No|TRUE|True|YES|Yes|false|no|true|yes)\b/,variable:/\b(?:PslDebug|errno|exit_status)\b/,builtin:{pattern:/\b(?:PslExecute|PslFunctionCall|PslFunctionExists|PslSetOptions|_snmp_debug|acos|add_diary|annotate|annotate_get|ascii_to_ebcdic|asctime|asin|atan|atexit|batch_set|blackout|cat|ceil|chan_exists|change_state|close|code_cvt|cond_signal|cond_wait|console_type|convert_base|convert_date|convert_locale_date|cos|cosh|create|date|dcget_text|destroy|destroy_lock|dget_text|difference|dump_hist|ebcdic_to_ascii|encrypt|event_archive|event_catalog_get|event_check|event_query|event_range_manage|event_range_query|event_report|event_schedule|event_trigger|event_trigger2|execute|exists|exp|fabs|file|floor|fmod|fopen|fseek|ftell|full_discovery|get|get_chan_info|get_ranges|get_text|get_vars|getenv|gethostinfo|getpid|getpname|grep|history|history_get_retention|in_transition|index|int|internal|intersection|is_var|isnumber|join|kill|length|lines|lock|lock_info|log|log10|loge|matchline|msg_check|msg_get_format|msg_get_severity|msg_printf|msg_sprintf|ntharg|nthargf|nthline|nthlinef|num_bytes|num_consoles|pconfig|popen|poplines|pow|print|printf|proc_exists|process|random|read|readln|refresh_parameters|remote_check|remote_close|remote_event_query|remote_event_trigger|remote_file_send|remote_open|remove|replace|rindex|sec_check_priv|sec_store_get|sec_store_set|set|set_alarm_ranges|set_locale|share|sin|sinh|sleep|snmp_agent_config|snmp_agent_start|snmp_agent_stop|snmp_close|snmp_config|snmp_get|snmp_get_next|snmp_h_get|snmp_h_get_next|snmp_h_set|snmp_open|snmp_set|snmp_trap_ignore|snmp_trap_listen|snmp_trap_raise_std_trap|snmp_trap_receive|snmp_trap_register_im|snmp_trap_send|snmp_walk|sopen|sort|splitline|sprintf|sqrt|srandom|str_repeat|strcasecmp|subset|substr|system|tail|tan|tanh|text_domain|time|tmpnam|tolower|toupper|trace_psl_process|trim|union|unique|unlock|unset|va_arg|va_start|write)\b/,alias:"builtin-function"},"foreach-variable":{pattern:/(\bforeach\s+(?:(?:\w+\b|"(?:\\.|[^\\"])*")\s+){0,2})[_a-zA-Z]\w*(?=\s*\()/,lookbehind:!0,greedy:!0},function:/\b[_a-z]\w*\b(?=\s*\()/i,number:/\b(?:0x[0-9a-f]+|\d+(?:\.\d+)?)\b/i,operator:/--|\+\+|&&=?|\|\|=?|<<=?|>>=?|[=!]~|[-+*/%&|^!=<>]=?|\.|[:?]/,punctuation:/[(){}\[\];,]/}}Lh.displayName="pcaxis";Lh.aliases=["px"];function Lh(e){e.languages.pcaxis={string:/"[^"]*"/,keyword:{pattern:/((?:^|;)\s*)[-A-Z\d]+(?:\s*\[[-\w]+\])?(?:\s*\("[^"]*"(?:,\s*"[^"]*")*\))?(?=\s*=)/,lookbehind:!0,greedy:!0,inside:{keyword:/^[-A-Z\d]+/,language:{pattern:/^(\s*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/^\[|\]$/,property:/[-\w]+/}},"sub-key":{pattern:/^(\s*)\S[\s\S]*/,lookbehind:!0,inside:{parameter:{pattern:/"[^"]*"/,alias:"property"},punctuation:/^\(|\)$|,/}}}},operator:/=/,tlist:{pattern:/TLIST\s*\(\s*\w+(?:(?:\s*,\s*"[^"]*")+|\s*,\s*"[^"]*"-"[^"]*")?\s*\)/,greedy:!0,inside:{function:/^TLIST/,property:{pattern:/^(\s*\(\s*)\w+/,lookbehind:!0},string:/"[^"]*"/,punctuation:/[(),]/,operator:/-/}},punctuation:/[;,]/,number:{pattern:/(^|\s)\d+(?:\.\d+)?(?!\S)/,lookbehind:!0},boolean:/NO|YES/},e.languages.px=e.languages.pcaxis}jh.displayName="peoplecode";jh.aliases=["pcode"];function jh(e){e.languages.peoplecode={comment:RegExp([/\/\*[\s\S]*?\*\//.source,/\bREM[^;]*;/.source,/<\*(?:[^<*]|\*(?!>)|<(?!\*)|<\*(?:(?!\*>)[\s\S])*\*>)*\*>/.source,/\/\+[\s\S]*?\+\//.source].join("|")),string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},variable:/%\w+/,"function-definition":{pattern:/((?:^|[^\w-])(?:function|method)\s+)\w+/i,lookbehind:!0,alias:"function"},"class-name":{pattern:/((?:^|[^-\w])(?:as|catch|class|component|create|extends|global|implements|instance|local|of|property|returns)\s+)\w+(?::\w+)*/i,lookbehind:!0,inside:{punctuation:/:/}},keyword:/\b(?:abstract|alias|as|catch|class|component|constant|create|declare|else|end-(?:class|evaluate|for|function|get|if|method|set|try|while)|evaluate|extends|for|function|get|global|if|implements|import|instance|library|local|method|null|of|out|peopleCode|private|program|property|protected|readonly|ref|repeat|returns?|set|step|then|throw|to|try|until|value|when(?:-other)?|while)\b/i,"operator-keyword":{pattern:/\b(?:and|not|or)\b/i,alias:"operator"},function:/[_a-z]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/i,number:/\b\d+(?:\.\d+)?\b/,operator:/<>|[<>]=?|!=|\*\*|[-+*/|=@]/,punctuation:/[:.;,()[\]]/},e.languages.pcode=e.languages.peoplecode}Mh.displayName="phpdoc";Mh.aliases=[];function Mh(e){e.register(ba),e.register(hs),(function(t){var n=/(?:\b[a-zA-Z]\w*|[|\\[\]])+/.source;t.languages.phpdoc=t.languages.extend("javadoclike",{parameter:{pattern:RegExp("(@(?:global|param|property(?:-read|-write)?|var)\\s+(?:"+n+"\\s+)?)\\$\\w+"),lookbehind:!0}}),t.languages.insertBefore("phpdoc","keyword",{"class-name":[{pattern:RegExp("(@(?:global|package|param|property(?:-read|-write)?|return|subpackage|throws|var)\\s+)"+n),lookbehind:!0,inside:{keyword:/\b(?:array|bool|boolean|callback|double|false|float|int|integer|mixed|null|object|resource|self|string|true|void)\b/,punctuation:/[|\\[\]()]/}}]}),t.languages.javadoclike.addSupport("php",t.languages.phpdoc)})(e)}Fh.displayName="php-extras";Fh.aliases=[];function Fh(e){e.register(hs),e.languages.insertBefore("php","variable",{this:{pattern:/\$this\b/,alias:"keyword"},global:/\$(?:GLOBALS|HTTP_RAW_POST_DATA|_(?:COOKIE|ENV|FILES|GET|POST|REQUEST|SERVER|SESSION)|argc|argv|http_response_header|php_errormsg)\b/,scope:{pattern:/\b[\w\\]+::/,inside:{keyword:/\b(?:parent|self|static)\b/,punctuation:/::|\\/}}})}Ph.displayName="plant-uml";Ph.aliases=["plantuml"];function Ph(e){(function(t){var n=/\$\w+|%[a-z]+%/,r=/\[[^[\]]*\]/.source,s=/(?:[drlu]|do|down|le|left|ri|right|up)/.source,i="(?:-+"+s+"-+|\\.+"+s+"\\.+|-+(?:"+r+"-*)?|"+r+"-+|\\.+(?:"+r+"\\.*)?|"+r+"\\.+)",o=/(?:<{1,2}|\/{1,2}|\\{1,2}|<\||[#*^+}xo])/.source,l=/(?:>{1,2}|\/{1,2}|\\{1,2}|\|>|[#*^+{xo])/.source,u=/[[?]?[ox]?/.source,c=/[ox]?[\]?]?/.source,d=u+"(?:"+i+l+"|"+o+i+"(?:"+l+")?)"+c;t.languages["plant-uml"]={comment:{pattern:/(^[ \t]*)(?:'.*|\/'[\s\S]*?'\/)/m,lookbehind:!0,greedy:!0},preprocessor:{pattern:/(^[ \t]*)!.*/m,lookbehind:!0,greedy:!0,alias:"property",inside:{variable:n}},delimiter:{pattern:/(^[ \t]*)@(?:end|start)uml\b/m,lookbehind:!0,greedy:!0,alias:"punctuation"},arrow:{pattern:RegExp(/(^|[^-.<>?|\\[\]ox])/.source+d+/(?![-.<>?|\\\]ox])/.source),lookbehind:!0,greedy:!0,alias:"operator",inside:{expression:{pattern:/(\[)[^[\]]+(?=\])/,lookbehind:!0,inside:null},punctuation:/\[(?=$|\])|^\]/}},string:{pattern:/"[^"]*"/,greedy:!0},text:{pattern:/(\[[ \t]*[\r\n]+(?![\r\n]))[^\]]*(?=\])/,lookbehind:!0,greedy:!0,alias:"string"},keyword:[{pattern:/^([ \t]*)(?:abstract\s+class|end\s+(?:box|fork|group|merge|note|ref|split|title)|(?:fork|split)(?:\s+again)?|activate|actor|agent|alt|annotation|artifact|autoactivate|autonumber|backward|binary|boundary|box|break|caption|card|case|circle|class|clock|cloud|collections|component|concise|control|create|critical|database|deactivate|destroy|detach|diamond|else|elseif|end|end[hr]note|endif|endswitch|endwhile|entity|enum|file|folder|footer|frame|group|[hr]?note|header|hexagon|hide|if|interface|label|legend|loop|map|namespace|network|newpage|node|nwdiag|object|opt|package|page|par|participant|person|queue|rectangle|ref|remove|repeat|restore|return|robust|scale|set|show|skinparam|stack|start|state|stop|storage|switch|title|together|usecase|usecase\/|while)(?=\s|$)/m,lookbehind:!0,greedy:!0},/\b(?:elseif|equals|not|while)(?=\s*\()/,/\b(?:as|is|then)\b/],divider:{pattern:/^==.+==$/m,greedy:!0,alias:"important"},time:{pattern:/@(?:\d+(?:[:/]\d+){2}|[+-]?\d+|:[a-z]\w*(?:[+-]\d+)?)\b/i,greedy:!0,alias:"number"},color:{pattern:/#(?:[a-z_]+|[a-fA-F0-9]+)\b/,alias:"symbol"},variable:n,punctuation:/[:,;()[\]{}]|\.{3}/},t.languages["plant-uml"].arrow.inside.expression.inside=t.languages["plant-uml"],t.languages.plantuml=t.languages["plant-uml"]})(e)}Bh.displayName="plsql";Bh.aliases=[];function Bh(e){e.register(fa),e.languages.plsql=e.languages.extend("sql",{comment:{pattern:/\/\*[\s\S]*?\*\/|--.*/,greedy:!0},keyword:/\b(?:A|ACCESSIBLE|ADD|AGENT|AGGREGATE|ALL|ALTER|AND|ANY|ARRAY|AS|ASC|AT|ATTRIBUTE|AUTHID|AVG|BEGIN|BETWEEN|BFILE_BASE|BINARY|BLOB_BASE|BLOCK|BODY|BOTH|BOUND|BULK|BY|BYTE|C|CALL|CALLING|CASCADE|CASE|CHAR|CHARACTER|CHARSET|CHARSETFORM|CHARSETID|CHAR_BASE|CHECK|CLOB_BASE|CLONE|CLOSE|CLUSTER|CLUSTERS|COLAUTH|COLLECT|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPILED|COMPRESS|CONNECT|CONSTANT|CONSTRUCTOR|CONTEXT|CONTINUE|CONVERT|COUNT|CRASH|CREATE|CREDENTIAL|CURRENT|CURSOR|CUSTOMDATUM|DANGLING|DATA|DATE|DATE_BASE|DAY|DECLARE|DEFAULT|DEFINE|DELETE|DESC|DETERMINISTIC|DIRECTORY|DISTINCT|DOUBLE|DROP|DURATION|ELEMENT|ELSE|ELSIF|EMPTY|END|ESCAPE|EXCEPT|EXCEPTION|EXCEPTIONS|EXCLUSIVE|EXECUTE|EXISTS|EXIT|EXTERNAL|FETCH|FINAL|FIRST|FIXED|FLOAT|FOR|FORALL|FORCE|FROM|FUNCTION|GENERAL|GOTO|GRANT|GROUP|HASH|HAVING|HEAP|HIDDEN|HOUR|IDENTIFIED|IF|IMMEDIATE|IMMUTABLE|IN|INCLUDING|INDEX|INDEXES|INDICATOR|INDICES|INFINITE|INSERT|INSTANTIABLE|INT|INTERFACE|INTERSECT|INTERVAL|INTO|INVALIDATE|IS|ISOLATION|JAVA|LANGUAGE|LARGE|LEADING|LENGTH|LEVEL|LIBRARY|LIKE|LIKE2|LIKE4|LIKEC|LIMIT|LIMITED|LOCAL|LOCK|LONG|LOOP|MAP|MAX|MAXLEN|MEMBER|MERGE|MIN|MINUS|MINUTE|MOD|MODE|MODIFY|MONTH|MULTISET|MUTABLE|NAME|NAN|NATIONAL|NATIVE|NCHAR|NEW|NOCOMPRESS|NOCOPY|NOT|NOWAIT|NULL|NUMBER_BASE|OBJECT|OCICOLL|OCIDATE|OCIDATETIME|OCIDURATION|OCIINTERVAL|OCILOBLOCATOR|OCINUMBER|OCIRAW|OCIREF|OCIREFCURSOR|OCIROWID|OCISTRING|OCITYPE|OF|OLD|ON|ONLY|OPAQUE|OPEN|OPERATOR|OPTION|OR|ORACLE|ORADATA|ORDER|ORGANIZATION|ORLANY|ORLVARY|OTHERS|OUT|OVERLAPS|OVERRIDING|PACKAGE|PARALLEL_ENABLE|PARAMETER|PARAMETERS|PARENT|PARTITION|PASCAL|PERSISTABLE|PIPE|PIPELINED|PLUGGABLE|POLYMORPHIC|PRAGMA|PRECISION|PRIOR|PRIVATE|PROCEDURE|PUBLIC|RAISE|RANGE|RAW|READ|RECORD|REF|REFERENCE|RELIES_ON|REM|REMAINDER|RENAME|RESOURCE|RESULT|RESULT_CACHE|RETURN|RETURNING|REVERSE|REVOKE|ROLLBACK|ROW|SAMPLE|SAVE|SAVEPOINT|SB1|SB2|SB4|SECOND|SEGMENT|SELECT|SELF|SEPARATE|SEQUENCE|SERIALIZABLE|SET|SHARE|SHORT|SIZE|SIZE_T|SOME|SPARSE|SQL|SQLCODE|SQLDATA|SQLNAME|SQLSTATE|STANDARD|START|STATIC|STDDEV|STORED|STRING|STRUCT|STYLE|SUBMULTISET|SUBPARTITION|SUBSTITUTABLE|SUBTYPE|SUM|SYNONYM|TABAUTH|TABLE|TDO|THE|THEN|TIME|TIMESTAMP|TIMEZONE_ABBR|TIMEZONE_HOUR|TIMEZONE_MINUTE|TIMEZONE_REGION|TO|TRAILING|TRANSACTION|TRANSACTIONAL|TRUSTED|TYPE|UB1|UB2|UB4|UNDER|UNION|UNIQUE|UNPLUG|UNSIGNED|UNTRUSTED|UPDATE|USE|USING|VALIST|VALUE|VALUES|VARIABLE|VARIANCE|VARRAY|VARYING|VIEW|VIEWS|VOID|WHEN|WHERE|WHILE|WITH|WORK|WRAPPED|WRITE|YEAR|ZONE)\b/i,operator:/:=?|=>|[<>^~!]=|\.\.|\|\||\*\*|[-+*/%<>=@]/}),e.languages.insertBefore("plsql","operator",{label:{pattern:/<<\s*\w+\s*>>/,alias:"symbol"}})}Uh.displayName="powerquery";Uh.aliases=["mscript","pq"];function Uh(e){e.languages.powerquery={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},"quoted-identifier":{pattern:/#"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},string:{pattern:/(?:#!)?"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},constant:[/\bDay\.(?:Friday|Monday|Saturday|Sunday|Thursday|Tuesday|Wednesday)\b/,/\bTraceLevel\.(?:Critical|Error|Information|Verbose|Warning)\b/,/\bOccurrence\.(?:All|First|Last)\b/,/\bOrder\.(?:Ascending|Descending)\b/,/\bRoundingMode\.(?:AwayFromZero|Down|ToEven|TowardZero|Up)\b/,/\bMissingField\.(?:Error|Ignore|UseNull)\b/,/\bQuoteStyle\.(?:Csv|None)\b/,/\bJoinKind\.(?:FullOuter|Inner|LeftAnti|LeftOuter|RightAnti|RightOuter)\b/,/\bGroupKind\.(?:Global|Local)\b/,/\bExtraValues\.(?:Error|Ignore|List)\b/,/\bJoinAlgorithm\.(?:Dynamic|LeftHash|LeftIndex|PairwiseHash|RightHash|RightIndex|SortMerge)\b/,/\bJoinSide\.(?:Left|Right)\b/,/\bPrecision\.(?:Decimal|Double)\b/,/\bRelativePosition\.From(?:End|Start)\b/,/\bTextEncoding\.(?:Ascii|BigEndianUnicode|Unicode|Utf16|Utf8|Windows)\b/,/\b(?:Any|Binary|Date|DateTime|DateTimeZone|Duration|Function|Int16|Int32|Int64|Int8|List|Logical|None|Number|Record|Table|Text|Time)\.Type\b/,/\bnull\b/],boolean:/\b(?:false|true)\b/,keyword:/\b(?:and|as|each|else|error|if|in|is|let|meta|not|nullable|optional|or|otherwise|section|shared|then|try|type)\b|#(?:binary|date|datetime|datetimezone|duration|infinity|nan|sections|shared|table|time)\b/,function:{pattern:/(^|[^#\w.])[a-z_][\w.]*(?=\s*\()/i,lookbehind:!0},"data-type":{pattern:/\b(?:any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|number|record|table|text|time)\b/,alias:"class-name"},number:{pattern:/\b0x[\da-f]+\b|(?:[+-]?(?:\b\d+\.)?\b\d+|[+-]\.\d+|(^|[^.])\B\.\d+)(?:e[+-]?\d+)?\b/i,lookbehind:!0},operator:/[-+*\/&?@^]|<(?:=>?|>)?|>=?|=>?|\.\.\.?/,punctuation:/[,;\[\](){}]/},e.languages.pq=e.languages.powerquery,e.languages.mscript=e.languages.powerquery}$h.displayName="powershell";$h.aliases=[];function $h(e){(function(t){var n=t.languages.powershell={comment:[{pattern:/(^|[^`])<#[\s\S]*?#>/,lookbehind:!0},{pattern:/(^|[^`])#.*/,lookbehind:!0}],string:[{pattern:/"(?:`[\s\S]|[^`"])*"/,greedy:!0,inside:null},{pattern:/'(?:[^']|'')*'/,greedy:!0}],namespace:/\[[a-z](?:\[(?:\[[^\]]*\]|[^\[\]])*\]|[^\[\]])*\]/i,boolean:/\$(?:false|true)\b/i,variable:/\$\w+\b/,function:[/\b(?:Add|Approve|Assert|Backup|Block|Checkpoint|Clear|Close|Compare|Complete|Compress|Confirm|Connect|Convert|ConvertFrom|ConvertTo|Copy|Debug|Deny|Disable|Disconnect|Dismount|Edit|Enable|Enter|Exit|Expand|Export|Find|ForEach|Format|Get|Grant|Group|Hide|Import|Initialize|Install|Invoke|Join|Limit|Lock|Measure|Merge|Move|New|Open|Optimize|Out|Ping|Pop|Protect|Publish|Push|Read|Receive|Redo|Register|Remove|Rename|Repair|Request|Reset|Resize|Resolve|Restart|Restore|Resume|Revoke|Save|Search|Select|Send|Set|Show|Skip|Sort|Split|Start|Step|Stop|Submit|Suspend|Switch|Sync|Tee|Test|Trace|Unblock|Undo|Uninstall|Unlock|Unprotect|Unpublish|Unregister|Update|Use|Wait|Watch|Where|Write)-[a-z]+\b/i,/\b(?:ac|cat|chdir|clc|cli|clp|clv|compare|copy|cp|cpi|cpp|cvpa|dbp|del|diff|dir|ebp|echo|epal|epcsv|epsn|erase|fc|fl|ft|fw|gal|gbp|gc|gci|gcs|gdr|gi|gl|gm|gp|gps|group|gsv|gu|gv|gwmi|iex|ii|ipal|ipcsv|ipsn|irm|iwmi|iwr|kill|lp|ls|measure|mi|mount|move|mp|mv|nal|ndr|ni|nv|ogv|popd|ps|pushd|pwd|rbp|rd|rdr|ren|ri|rm|rmdir|rni|rnp|rp|rv|rvpa|rwmi|sal|saps|sasv|sbp|sc|select|set|shcm|si|sl|sleep|sls|sort|sp|spps|spsv|start|sv|swmi|tee|trcm|type|write)\b/i],keyword:/\b(?:Begin|Break|Catch|Class|Continue|Data|Define|Do|DynamicParam|Else|ElseIf|End|Exit|Filter|Finally|For|ForEach|From|Function|If|InlineScript|Parallel|Param|Process|Return|Sequence|Switch|Throw|Trap|Try|Until|Using|Var|While|Workflow)\b/i,operator:{pattern:/(^|\W)(?:!|-(?:b?(?:and|x?or)|as|(?:Not)?(?:Contains|In|Like|Match)|eq|ge|gt|is(?:Not)?|Join|le|lt|ne|not|Replace|sh[lr])\b|-[-=]?|\+[+=]?|[*\/%]=?)/i,lookbehind:!0},punctuation:/[|{}[\];(),.]/};n.string[0].inside={function:{pattern:/(^|[^`])\$\((?:\$\([^\r\n()]*\)|(?!\$\()[^\r\n)])*\)/,lookbehind:!0,inside:n},boolean:n.boolean,variable:n.variable}})(e)}zh.displayName="processing";zh.aliases=[];function zh(e){e.register(rt),e.languages.processing=e.languages.extend("clike",{keyword:/\b(?:break|case|catch|class|continue|default|else|extends|final|for|if|implements|import|new|null|private|public|return|static|super|switch|this|try|void|while)\b/,function:/\b\w+(?=\s*\()/,operator:/<[<=]?|>[>=]?|&&?|\|\|?|[%?]|[!=+\-*\/]=?/}),e.languages.insertBefore("processing","number",{constant:/\b(?!XML\b)[A-Z][A-Z\d_]+\b/,type:{pattern:/\b(?:boolean|byte|char|color|double|float|int|[A-Z]\w*)\b/,alias:"class-name"}})}Hh.displayName="prolog";Hh.aliases=[];function Hh(e){e.languages.prolog={comment:{pattern:/\/\*[\s\S]*?\*\/|%.*/,greedy:!0},string:{pattern:/(["'])(?:\1\1|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1(?!\1)/,greedy:!0},builtin:/\b(?:fx|fy|xf[xy]?|yfx?)\b/,function:/\b[a-z]\w*(?:(?=\()|\/\d+)/,number:/\b\d+(?:\.\d*)?/,operator:/[:\\=><\-?*@\/;+^|!$.]+|\b(?:is|mod|not|xor)\b/,punctuation:/[(){}\[\],]/}}Gh.displayName="promql";Gh.aliases=[];function Gh(e){(function(t){var n=["sum","min","max","avg","group","stddev","stdvar","count","count_values","bottomk","topk","quantile"],r=["on","ignoring","group_right","group_left","by","without"],s=["offset"],i=n.concat(r,s);t.languages.promql={comment:{pattern:/(^[ \t]*)#.*/m,lookbehind:!0},"vector-match":{pattern:new RegExp("((?:"+r.join("|")+")\\s*)\\([^)]*\\)"),lookbehind:!0,inside:{"label-key":{pattern:/\b[^,]+\b/,alias:"attr-name"},punctuation:/[(),]/}},"context-labels":{pattern:/\{[^{}]*\}/,inside:{"label-key":{pattern:/\b[a-z_]\w*(?=\s*(?:=|![=~]))/,alias:"attr-name"},"label-value":{pattern:/(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0,alias:"attr-value"},punctuation:/\{|\}|=~?|![=~]|,/}},"context-range":[{pattern:/\[[\w\s:]+\]/,inside:{punctuation:/\[|\]|:/,"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}},{pattern:/(\boffset\s+)\w+/,lookbehind:!0,inside:{"range-duration":{pattern:/\b(?:\d+(?:[smhdwy]|ms))+\b/i,alias:"number"}}}],keyword:new RegExp("\\b(?:"+i.join("|")+")\\b","i"),function:/\b[a-z_]\w*(?=\s*\()/i,number:/[-+]?(?:(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e[-+]?\d+)?\b|\b(?:0x[0-9a-f]+|nan|inf)\b)/i,operator:/[\^*/%+-]|==|!=|<=|<|>=|>|\b(?:and|or|unless)\b/i,punctuation:/[{};()`,.[\]]/}})(e)}Wh.displayName="properties";Wh.aliases=[];function Wh(e){e.languages.properties={comment:/^[ \t]*[#!].*$/m,value:{pattern:/(^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?: *[=:] *(?! )| ))(?:\\(?:\r\n|[\s\S])|[^\\\r\n])+/m,lookbehind:!0,alias:"attr-value"},key:{pattern:/^[ \t]*(?:\\(?:\r\n|[\s\S])|[^\\\s:=])+(?= *[=:]| )/m,alias:"attr-name"},punctuation:/[=:]/}}qh.displayName="protobuf";qh.aliases=[];function qh(e){e.register(rt),(function(t){var n=/\b(?:bool|bytes|double|s?fixed(?:32|64)|float|[su]?int(?:32|64)|string)\b/;t.languages.protobuf=t.languages.extend("clike",{"class-name":[{pattern:/(\b(?:enum|extend|message|service)\s+)[A-Za-z_]\w*(?=\s*\{)/,lookbehind:!0},{pattern:/(\b(?:rpc\s+\w+|returns)\s*\(\s*(?:stream\s+)?)\.?[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*(?=\s*\))/,lookbehind:!0}],keyword:/\b(?:enum|extend|extensions|import|message|oneof|option|optional|package|public|repeated|required|reserved|returns|rpc(?=\s+\w)|service|stream|syntax|to)\b(?!\s*=\s*\d)/,function:/\b[a-z_]\w*(?=\s*\()/i}),t.languages.insertBefore("protobuf","operator",{map:{pattern:/\bmap<\s*[\w.]+\s*,\s*[\w.]+\s*>(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/[<>.,]/,builtin:n}},builtin:n,"positional-class-name":{pattern:/(?:\b|\B\.)[a-z_]\w*(?:\.[a-z_]\w*)*(?=\s+[a-z_]\w*\s*[=;])/i,alias:"class-name",inside:{punctuation:/\./}},annotation:{pattern:/(\[\s*)[a-z_]\w*(?=\s*=)/i,lookbehind:!0}})})(e)}Vh.displayName="stylus";Vh.aliases=[];function Vh(e){(function(t){var n={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},r={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},s={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:n,number:r,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:n,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:r,punctuation:/[{}()\[\];:,]/};s.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:s}},s.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:s}},t.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:s}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:s}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:s}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:s.interpolation}},rest:s}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:s.interpolation,comment:s.comment,punctuation:/[{},]/}},func:s.func,string:s.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:s.interpolation,punctuation:/[{}()\[\];:.]/}})(e)}Yh.displayName="twig";Yh.aliases=[];function Yh(e){e.register(dn),e.languages.twig={comment:/^\{#[\s\S]*?#\}$/,"tag-name":{pattern:/(^\{%-?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%]-?|-?[%}]\}$/,alias:"punctuation"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,inside:{punctuation:/^['"]|['"]$/}},keyword:/\b(?:even|if|odd)\b/,boolean:/\b(?:false|null|true)\b/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,operator:[{pattern:/(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,lookbehind:!0},/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/],punctuation:/[()\[\]{}:.,]/},e.hooks.add("before-tokenize",function(t){if(t.language==="twig"){var n=/\{(?:#[\s\S]*?#|%[\s\S]*?%|\{[\s\S]*?\})\}/g;e.languages["markup-templating"].buildPlaceholders(t,"twig",n)}}),e.hooks.add("after-tokenize",function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"twig")})}Kh.displayName="pug";Kh.aliases=[];function Kh(e){e.register(cn),e.register(rn),(function(t){t.languages.pug={comment:{pattern:/(^([\t ]*))\/\/.*(?:(?:\r?\n|\r)\2[\t ].+)*/m,lookbehind:!0},"multiline-script":{pattern:/(^([\t ]*)script\b.*\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:t.languages.javascript},filter:{pattern:/(^([\t ]*)):.+(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"},text:/\S[\s\S]*/}},"multiline-plain-text":{pattern:/(^([\t ]*)[\w\-#.]+\.[\t ]*)(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/m,lookbehind:!0},markup:{pattern:/(^[\t ]*)<.+/m,lookbehind:!0,inside:t.languages.markup},doctype:{pattern:/((?:^|\n)[\t ]*)doctype(?: .+)?/,lookbehind:!0},"flow-control":{pattern:/(^[\t ]*)(?:case|default|each|else|if|unless|when|while)\b(?: .+)?/m,lookbehind:!0,inside:{each:{pattern:/^each .+? in\b/,inside:{keyword:/\b(?:each|in)\b/,punctuation:/,/}},branch:{pattern:/^(?:case|default|else|if|unless|when|while)\b/,alias:"keyword"},rest:t.languages.javascript}},keyword:{pattern:/(^[\t ]*)(?:append|block|extends|include|prepend)\b.+/m,lookbehind:!0},mixin:[{pattern:/(^[\t ]*)mixin .+/m,lookbehind:!0,inside:{keyword:/^mixin/,function:/\w+(?=\s*\(|\s*$)/,punctuation:/[(),.]/}},{pattern:/(^[\t ]*)\+.+/m,lookbehind:!0,inside:{name:{pattern:/^\+\w+/,alias:"function"},rest:t.languages.javascript}}],script:{pattern:/(^[\t ]*script(?:(?:&[^(]+)?\([^)]+\))*[\t ]).+/m,lookbehind:!0,inside:t.languages.javascript},"plain-text":{pattern:/(^[\t ]*(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?[\t ]).+/m,lookbehind:!0},tag:{pattern:/(^[\t ]*)(?!-)[\w\-#.]*[\w\-](?:(?:&[^(]+)?\([^)]+\))*\/?:?/m,lookbehind:!0,inside:{attributes:[{pattern:/&[^(]+\([^)]+\)/,inside:t.languages.javascript},{pattern:/\([^)]+\)/,inside:{"attr-value":{pattern:/(=\s*(?!\s))(?:\{[^}]*\}|[^,)\r\n]+)/,lookbehind:!0,inside:t.languages.javascript},"attr-name":/[\w-]+(?=\s*!?=|\s*[,)])/,punctuation:/[!=(),]+/}}],punctuation:/:/,"attr-id":/#[\w\-]+/,"attr-class":/\.[\w\-]+/}},code:[{pattern:/(^[\t ]*(?:-|!?=)).+/m,lookbehind:!0,inside:t.languages.javascript}],punctuation:/[.\-!=|]+/};for(var n=/(^([\t ]*)):<filter_name>(?:(?:\r?\n|\r(?!\n))(?:\2[\t ].+|\s*?(?=\r?\n|\r)))+/.source,r=[{filter:"atpl",language:"twig"},{filter:"coffee",language:"coffeescript"},"ejs","handlebars","less","livescript","markdown",{filter:"sass",language:"scss"},"stylus"],s={},i=0,o=r.length;i<o;i++){var l=r[i];l=typeof l=="string"?{filter:l,language:l}:l,t.languages[l.language]&&(s["filter-"+l.filter]={pattern:RegExp(n.replace("<filter_name>",function(){return l.filter}),"m"),lookbehind:!0,inside:{"filter-name":{pattern:/^:[\w-]+/,alias:"variable"},text:{pattern:/\S[\s\S]*/,alias:[l.language,"language-"+l.language],inside:t.languages[l.language]}}})}t.languages.insertBefore("pug","filter",s)})(e)}Zh.displayName="puppet";Zh.aliases=[];function Zh(e){(function(t){t.languages.puppet={heredoc:[{pattern:/(@\("([^"\r\n\/):]+)"(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,lookbehind:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/(@\(([^"\r\n\/):]+)(?:\/[nrts$uL]*)?\).*(?:\r?\n|\r))(?:.*(?:\r?\n|\r(?!\n)))*?[ \t]*(?:\|[ \t]*)?(?:-[ \t]*)?\2/,lookbehind:!0,greedy:!0,alias:"string",inside:{punctuation:/(?=\S).*\S(?= *$)/}},{pattern:/@\("?(?:[^"\r\n\/):]+)"?(?:\/[nrts$uL]*)?\)/,alias:"string",inside:{punctuation:{pattern:/(\().+?(?=\))/,lookbehind:!0}}}],"multiline-comment":{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0,greedy:!0,alias:"comment"},regex:{pattern:/((?:\bnode\s+|[~=\(\[\{,]\s*|[=+]>\s*|^\s*))\/(?:[^\/\\]|\\[\s\S])+\/(?:[imx]+\b|\B)/,lookbehind:!0,greedy:!0,inside:{"extended-regex":{pattern:/^\/(?:[^\/\\]|\\[\s\S])+\/[im]*x[im]*$/,inside:{comment:/#.*/}}}},comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},string:{pattern:/(["'])(?:\$\{(?:[^'"}]|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}|\$(?!\{)|(?!\1)[^\\$]|\\[\s\S])*\1/,greedy:!0,inside:{"double-quoted":{pattern:/^"[\s\S]*"$/,inside:{}}}},variable:{pattern:/\$(?:::)?\w+(?:::\w+)*/,inside:{punctuation:/::/}},"attr-name":/(?:\b\w+|\*)(?=\s*=>)/,function:[{pattern:/(\.)(?!\d)\w+/,lookbehind:!0},/\b(?:contain|debug|err|fail|include|info|notice|realize|require|tag|warning)\b|\b(?!\d)\w+(?=\()/],number:/\b(?:0x[a-f\d]+|\d+(?:\.\d+)?(?:e-?\d+)?)\b/i,boolean:/\b(?:false|true)\b/,keyword:/\b(?:application|attr|case|class|consumes|default|define|else|elsif|function|if|import|inherits|node|private|produces|type|undef|unless)\b/,datatype:{pattern:/\b(?:Any|Array|Boolean|Callable|Catalogentry|Class|Collection|Data|Default|Enum|Float|Hash|Integer|NotUndef|Numeric|Optional|Pattern|Regexp|Resource|Runtime|Scalar|String|Struct|Tuple|Type|Undef|Variant)\b/,alias:"symbol"},operator:/=[=~>]?|![=~]?|<(?:<\|?|[=~|-])?|>[>=]?|->?|~>|\|>?>?|[*\/%+?]|\b(?:and|in|or)\b/,punctuation:/[\[\]{}().,;]|:+/};var n=[{pattern:/(^|[^\\])\$\{(?:[^'"{}]|\{[^}]*\}|(["'])(?:(?!\2)[^\\]|\\[\s\S])*\2)+\}/,lookbehind:!0,inside:{"short-variable":{pattern:/(^\$\{)(?!\w+\()(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}},delimiter:{pattern:/^\$/,alias:"variable"},rest:t.languages.puppet}},{pattern:/(^|[^\\])\$(?:::)?\w+(?:::\w+)*/,lookbehind:!0,alias:"variable",inside:{punctuation:/::/}}];t.languages.puppet.heredoc[0].inside.interpolation=n,t.languages.puppet.string.inside["double-quoted"].inside.interpolation=n})(e)}Xh.displayName="pure";Xh.aliases=[];function Xh(e){(function(t){t.languages.pure={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0},/#!.+/],"inline-lang":{pattern:/%<[\s\S]+?%>/,greedy:!0,inside:{lang:{pattern:/(^%< *)-\*-.+?-\*-/,lookbehind:!0,alias:"comment"},delimiter:{pattern:/^%<.*|%>$/,alias:"punctuation"}}},string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},number:{pattern:/((?:\.\.)?)(?:\b(?:inf|nan)\b|\b0x[\da-f]+|(?:\b(?:0b)?\d+(?:\.\d+)?|\B\.\d+)(?:e[+-]?\d+)?L?)/i,lookbehind:!0},keyword:/\b(?:NULL|ans|break|bt|case|catch|cd|clear|const|def|del|dump|else|end|exit|extern|false|force|help|if|infix[lr]?|interface|let|ls|mem|namespace|nonfix|of|otherwise|outfix|override|postfix|prefix|private|public|pwd|quit|run|save|show|stats|then|throw|trace|true|type|underride|using|when|with)\b/,function:/\b(?:abs|add_(?:addr|constdef|(?:fundef|interface|macdef|typedef)(?:_at)?|vardef)|all|any|applp?|arity|bigintp?|blob(?:_crc|_size|p)?|boolp?|byte_c?string(?:_pointer)?|byte_(?:matrix|pointer)|calloc|cat|catmap|ceil|char[ps]?|check_ptrtag|chr|clear_sentry|clearsym|closurep?|cmatrixp?|cols?|colcat(?:map)?|colmap|colrev|colvector(?:p|seq)?|complex(?:_float_(?:matrix|pointer)|_matrix(?:_view)?|_pointer|p)?|conj|cookedp?|cst|cstring(?:_(?:dup|list|vector))?|curry3?|cyclen?|del_(?:constdef|fundef|interface|macdef|typedef|vardef)|delete|diag(?:mat)?|dim|dmatrixp?|do|double(?:_matrix(?:_view)?|_pointer|p)?|dowith3?|drop|dropwhile|eval(?:cmd)?|exactp|filter|fix|fixity|flip|float(?:_matrix|_pointer)|floor|fold[lr]1?|frac|free|funp?|functionp?|gcd|get(?:_(?:byte|constdef|double|float|fundef|int(?:64)?|interface(?:_typedef)?|long|macdef|pointer|ptrtag|sentry|short|string|typedef|vardef))?|globsym|hash|head|id|im|imatrixp?|index|inexactp|infp|init|insert|int(?:_matrix(?:_view)?|_pointer|p)?|int64_(?:matrix|pointer)|integerp?|iteraten?|iterwhile|join|keys?|lambdap?|last(?:err(?:pos)?)?|lcd|list[2p]?|listmap|make_ptrtag|malloc|map|matcat|matrixp?|max|member|min|nanp|nargs|nmatrixp?|null|numberp?|ord|pack(?:ed)?|pointer(?:_cast|_tag|_type|p)?|pow|pred|ptrtag|put(?:_(?:byte|double|float|int(?:64)?|long|pointer|short|string))?|rationalp?|re|realp?|realloc|recordp?|redim|reduce(?:_with)?|refp?|repeatn?|reverse|rlistp?|round|rows?|rowcat(?:map)?|rowmap|rowrev|rowvector(?:p|seq)?|same|scan[lr]1?|sentry|sgn|short_(?:matrix|pointer)|slice|smatrixp?|sort|split|str|strcat|stream|stride|string(?:_(?:dup|list|vector)|p)?|subdiag(?:mat)?|submat|subseq2?|substr|succ|supdiag(?:mat)?|symbolp?|tail|take|takewhile|thunkp?|transpose|trunc|tuplep?|typep|ubyte|uint(?:64)?|ulong|uncurry3?|unref|unzip3?|update|ushort|vals?|varp?|vector(?:p|seq)?|void|zip3?|zipwith3?)\b/,special:{pattern:/\b__[a-z]+__\b/i,alias:"builtin"},operator:/(?:[!"#$%&'*+,\-.\/:<=>?@\\^`|~\u00a1-\u00bf\u00d7-\u00f7\u20d0-\u2bff]|\b_+\b)+|\b(?:and|div|mod|not|or)\b/,punctuation:/[(){}\[\];,|]/};var n=["c",{lang:"c++",alias:"cpp"},"fortran"],r=/%< *-\*- *<lang>\d* *-\*-[\s\S]+?%>/.source;n.forEach(function(s){var i=s;if(typeof s!="string"&&(i=s.alias,s=s.lang),t.languages[i]){var o={};o["inline-lang-"+i]={pattern:RegExp(r.replace("<lang>",s.replace(/([.+*?\/\\(){}\[\]])/g,"\\$1")),"i"),inside:t.util.clone(t.languages.pure["inline-lang"].inside)},o["inline-lang-"+i].inside.rest=t.util.clone(t.languages[i]),t.languages.insertBefore("pure","inline-lang",o)}}),t.languages.c&&(t.languages.pure["inline-lang"].inside.rest=t.util.clone(t.languages.c))})(e)}Qh.displayName="purebasic";Qh.aliases=["pbfasm"];function Qh(e){e.register(rt),e.languages.purebasic=e.languages.extend("clike",{comment:/;.*/,keyword:/\b(?:align|and|as|break|calldebugger|case|compilercase|compilerdefault|compilerelse|compilerelseif|compilerendif|compilerendselect|compilererror|compilerif|compilerselect|continue|data|datasection|debug|debuglevel|declare|declarec|declarecdll|declaredll|declaremodule|default|define|dim|disableasm|disabledebugger|disableexplicit|else|elseif|enableasm|enabledebugger|enableexplicit|end|enddatasection|enddeclaremodule|endenumeration|endif|endimport|endinterface|endmacro|endmodule|endprocedure|endselect|endstructure|endstructureunion|endwith|enumeration|extends|fakereturn|for|foreach|forever|global|gosub|goto|if|import|importc|includebinary|includefile|includepath|interface|macro|module|newlist|newmap|next|not|or|procedure|procedurec|procedurecdll|proceduredll|procedurereturn|protected|prototype|prototypec|read|redim|repeat|restore|return|runtime|select|shared|static|step|structure|structureunion|swap|threaded|to|until|wend|while|with|xincludefile|xor)\b/i,function:/\b\w+(?:\.\w+)?\s*(?=\()/,number:/(?:\$[\da-f]+|\b-?(?:\d+(?:\.\d+)?|\.\d+)(?:e[+-]?\d+)?)\b/i,operator:/(?:@\*?|\?|\*)\w+\$?|-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|?\||[~^%?*/@]/}),e.languages.insertBefore("purebasic","keyword",{tag:/#\w+\$?/,asm:{pattern:/(^[\t ]*)!.*/m,lookbehind:!0,alias:"tag",inside:{comment:/;.*/,string:{pattern:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"label-reference-anonymous":{pattern:/(!\s*j[a-z]+\s+)@[fb]/i,lookbehind:!0,alias:"fasm-label"},"label-reference-addressed":{pattern:/(!\s*j[a-z]+\s+)[A-Z._?$@][\w.?$@~#]*/i,lookbehind:!0,alias:"fasm-label"},keyword:[/\b(?:extern|global)\b[^;\r\n]*/i,/\b(?:CPU|DEFAULT|FLOAT)\b.*/],function:{pattern:/^([\t ]*!\s*)[\da-z]+(?=\s|$)/im,lookbehind:!0},"function-inline":{pattern:/(:\s*)[\da-z]+(?=\s)/i,lookbehind:!0,alias:"function"},label:{pattern:/^([\t ]*!\s*)[A-Za-z._?$@][\w.?$@~#]*(?=:)/m,lookbehind:!0,alias:"fasm-label"},register:/\b(?:st\d|[xyz]mm\d\d?|[cdt]r\d|r\d\d?[bwd]?|[er]?[abcd]x|[abcd][hl]|[er]?(?:bp|di|si|sp)|[cdefgs]s|mm\d+)\b/i,number:/(?:\b|-|(?=\$))(?:0[hx](?:[\da-f]*\.)?[\da-f]+(?:p[+-]?\d+)?|\d[\da-f]+[hx]|\$\d[\da-f]*|0[oq][0-7]+|[0-7]+[oq]|0[by][01]+|[01]+[by]|0[dt]\d+|(?:\d+(?:\.\d+)?|\.\d+)(?:\.?e[+-]?\d+)?[dt]?)\b/i,operator:/[\[\]*+\-/%<>=&|$!,.:]/}}}),delete e.languages.purebasic["class-name"],delete e.languages.purebasic.boolean,e.languages.pbfasm=e.languages.purebasic}Jh.displayName="purescript";Jh.aliases=["purs"];function Jh(e){e.register(Yi),e.languages.purescript=e.languages.extend("haskell",{keyword:/\b(?:ado|case|class|data|derive|do|else|forall|if|in|infixl|infixr|instance|let|module|newtype|of|primitive|then|type|where)\b|∀/,"import-statement":{pattern:/(^[\t ]*)import\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*(?:\s+as\s+[A-Z][\w']*(?:\.[A-Z][\w']*)*)?(?:\s+hiding\b)?/m,lookbehind:!0,inside:{keyword:/\b(?:as|hiding|import)\b/,punctuation:/\./}},builtin:/\b(?:absurd|add|ap|append|apply|between|bind|bottom|clamp|compare|comparing|compose|conj|const|degree|discard|disj|div|eq|flap|flip|gcd|identity|ifM|join|lcm|liftA1|liftM1|map|max|mempty|min|mod|mul|negate|not|notEq|one|otherwise|recip|show|sub|top|unit|unless|unlessM|void|when|whenM|zero)\b/,operator:[e.languages.haskell.operator[0],e.languages.haskell.operator[2],/[\xa2-\xa6\xa8\xa9\xac\xae-\xb1\xb4\xb8\xd7\xf7\u02c2-\u02c5\u02d2-\u02df\u02e5-\u02eb\u02ed\u02ef-\u02ff\u0375\u0384\u0385\u03f6\u0482\u058d-\u058f\u0606-\u0608\u060b\u060e\u060f\u06de\u06e9\u06fd\u06fe\u07f6\u07fe\u07ff\u09f2\u09f3\u09fa\u09fb\u0af1\u0b70\u0bf3-\u0bfa\u0c7f\u0d4f\u0d79\u0e3f\u0f01-\u0f03\u0f13\u0f15-\u0f17\u0f1a-\u0f1f\u0f34\u0f36\u0f38\u0fbe-\u0fc5\u0fc7-\u0fcc\u0fce\u0fcf\u0fd5-\u0fd8\u109e\u109f\u1390-\u1399\u166d\u17db\u1940\u19de-\u19ff\u1b61-\u1b6a\u1b74-\u1b7c\u1fbd\u1fbf-\u1fc1\u1fcd-\u1fcf\u1fdd-\u1fdf\u1fed-\u1fef\u1ffd\u1ffe\u2044\u2052\u207a-\u207c\u208a-\u208c\u20a0-\u20bf\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211e-\u2123\u2125\u2127\u2129\u212e\u213a\u213b\u2140-\u2144\u214a-\u214d\u214f\u218a\u218b\u2190-\u2307\u230c-\u2328\u232b-\u2426\u2440-\u244a\u249c-\u24e9\u2500-\u2767\u2794-\u27c4\u27c7-\u27e5\u27f0-\u2982\u2999-\u29d7\u29dc-\u29fb\u29fe-\u2b73\u2b76-\u2b95\u2b97-\u2bff\u2ce5-\u2cea\u2e50\u2e51\u2e80-\u2e99\u2e9b-\u2ef3\u2f00-\u2fd5\u2ff0-\u2ffb\u3004\u3012\u3013\u3020\u3036\u3037\u303e\u303f\u309b\u309c\u3190\u3191\u3196-\u319f\u31c0-\u31e3\u3200-\u321e\u322a-\u3247\u3250\u3260-\u327f\u328a-\u32b0\u32c0-\u33ff\u4dc0-\u4dff\ua490-\ua4c6\ua700-\ua716\ua720\ua721\ua789\ua78a\ua828-\ua82b\ua836-\ua839\uaa77-\uaa79\uab5b\uab6a\uab6b\ufb29\ufbb2-\ufbc1\ufdfc\ufdfd\ufe62\ufe64-\ufe66\ufe69\uff04\uff0b\uff1c-\uff1e\uff3e\uff40\uff5c\uff5e\uffe0-\uffe6\uffe8-\uffee\ufffc\ufffd]/]}),e.languages.purs=e.languages.purescript}eg.displayName="qsharp";eg.aliases=["qs"];function eg(e){e.register(rt),(function(t){function n(m,b){return m.replace(/<<(\d+)>>/g,function(x,y){return"(?:"+b[+y]+")"})}function r(m,b,x){return RegExp(n(m,b),"")}function s(m,b){for(var x=0;x<b;x++)m=m.replace(/<<self>>/g,function(){return"(?:"+m+")"});return m.replace(/<<self>>/g,"[^\\s\\S]")}var i={type:"Adj BigInt Bool Ctl Double false Int One Pauli PauliI PauliX PauliY PauliZ Qubit Range Result String true Unit Zero",other:"Adjoint adjoint apply as auto body borrow borrowing Controlled controlled distribute elif else fail fixup for function if in internal intrinsic invert is let mutable namespace new newtype open operation repeat return self set until use using while within"};function o(m){return"\\b(?:"+m.trim().replace(/ /g,"|")+")\\b"}var l=RegExp(o(i.type+" "+i.other)),u=/\b[A-Za-z_]\w*\b/.source,c=n(/<<0>>(?:\s*\.\s*<<0>>)*/.source,[u]),d={keyword:l,punctuation:/[<>()?,.:[\]]/},p=/"(?:\\.|[^\\"])*"/.source;t.languages.qsharp=t.languages.extend("clike",{comment:/\/\/.*/,string:[{pattern:r(/(^|[^$\\])<<0>>/.source,[p]),lookbehind:!0,greedy:!0}],"class-name":[{pattern:r(/(\b(?:as|open)\s+)<<0>>(?=\s*(?:;|as\b))/.source,[c]),lookbehind:!0,inside:d},{pattern:r(/(\bnamespace\s+)<<0>>(?=\s*\{)/.source,[c]),lookbehind:!0,inside:d}],keyword:l,number:/(?:\b0(?:x[\da-f]+|b[01]+|o[0-7]+)|(?:\B\.\d+|\b\d+(?:\.\d*)?)(?:e[-+]?\d+)?)l?\b/i,operator:/\band=|\bor=|\band\b|\bnot\b|\bor\b|<[-=]|[-=]>|>>>=?|<<<=?|\^\^\^=?|\|\|\|=?|&&&=?|w\/=?|~~~|[*\/+\-^=!%]=?/,punctuation:/::|[{}[\];(),.:]/}),t.languages.insertBefore("qsharp","number",{range:{pattern:/\.\./,alias:"operator"}});var f=s(n(/\{(?:[^"{}]|<<0>>|<<self>>)*\}/.source,[p]),2);t.languages.insertBefore("qsharp","string",{"interpolation-string":{pattern:r(/\$"(?:\\.|<<0>>|[^\\"{])*"/.source,[f]),greedy:!0,inside:{interpolation:{pattern:r(/((?:^|[^\\])(?:\\\\)*)<<0>>/.source,[f]),lookbehind:!0,inside:{punctuation:/^\{|\}$/,expression:{pattern:/[\s\S]+/,alias:"language-qsharp",inside:t.languages.qsharp}}},string:/[\s\S]+/}}})})(e),e.languages.qs=e.languages.qsharp}tg.displayName="q";tg.aliases=[];function tg(e){e.languages.q={string:/"(?:\\.|[^"\\\r\n])*"/,comment:[{pattern:/([\t )\]}])\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|\r?\n|\r)\/[\t ]*(?:(?:\r?\n|\r)(?:.*(?:\r?\n|\r(?!\n)))*?(?:\\(?=[\t ]*(?:\r?\n|\r))|$)|\S.*)/,lookbehind:!0,greedy:!0},{pattern:/^\\[\t ]*(?:\r?\n|\r)[\s\S]+/m,greedy:!0},{pattern:/^#!.+/m,greedy:!0}],symbol:/`(?::\S+|[\w.]*)/,datetime:{pattern:/0N[mdzuvt]|0W[dtz]|\d{4}\.\d\d(?:m|\.\d\d(?:T(?:\d\d(?::\d\d(?::\d\d(?:[.:]\d\d\d)?)?)?)?)?[dz]?)|\d\d:\d\d(?::\d\d(?:[.:]\d\d\d)?)?[uvt]?/,alias:"number"},number:/\b(?![01]:)(?:0N[hje]?|0W[hj]?|0[wn]|0x[\da-fA-F]+|\d+(?:\.\d*)?(?:e[+-]?\d+)?[hjfeb]?)/,keyword:/\\\w+\b|\b(?:abs|acos|aj0?|all|and|any|asc|asin|asof|atan|attr|avgs?|binr?|by|ceiling|cols|cor|cos|count|cov|cross|csv|cut|delete|deltas|desc|dev|differ|distinct|div|do|dsave|ej|enlist|eval|except|exec|exit|exp|fby|fills|first|fkeys|flip|floor|from|get|getenv|group|gtime|hclose|hcount|hdel|hopen|hsym|iasc|identity|idesc|if|ij|in|insert|inter|inv|keys?|last|like|list|ljf?|load|log|lower|lsq|ltime|ltrim|mavg|maxs?|mcount|md5|mdev|med|meta|mins?|mmax|mmin|mmu|mod|msum|neg|next|not|null|or|over|parse|peach|pj|plist|prds?|prev|prior|rand|rank|ratios|raze|read0|read1|reciprocal|reval|reverse|rload|rotate|rsave|rtrim|save|scan|scov|sdev|select|set|setenv|show|signum|sin|sqrt|ssr?|string|sublist|sums?|sv|svar|system|tables|tan|til|trim|txf|type|uj|ungroup|union|update|upper|upsert|value|var|views?|vs|wavg|where|while|within|wj1?|wsum|ww|xasc|xbar|xcols?|xdesc|xexp|xgroup|xkey|xlog|xprev|xrank)\b/,adverb:{pattern:/['\/\\]:?|\beach\b/,alias:"function"},verb:{pattern:/(?:\B\.\B|\b[01]:|<[=>]?|>=?|[:+\-*%,!?~=|$&#@^]):?|\b_\b:?/,alias:"operator"},punctuation:/[(){}\[\];.]/}}ng.displayName="qml";ng.aliases=[];function ng(e){e.register(cn),(function(t){for(var n=/"(?:\\.|[^\\"\r\n])*"|'(?:\\.|[^\\'\r\n])*'/.source,r=/\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))*\*\//.source,s=/(?:[^\\()[\]{}"'/]|<string>|\/(?![*/])|<comment>|\(<expr>*\)|\[<expr>*\]|\{<expr>*\}|\\[\s\S])/.source.replace(/<string>/g,function(){return n}).replace(/<comment>/g,function(){return r}),i=0;i<2;i++)s=s.replace(/<expr>/g,function(){return s});s=s.replace(/<expr>/g,"[^\\s\\S]"),t.languages.qml={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},"javascript-function":{pattern:RegExp(/((?:^|;)[ \t]*)function\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*\(<js>*\)\s*\{<js>*\}/.source.replace(/<js>/g,function(){return s}),"m"),lookbehind:!0,greedy:!0,alias:"language-javascript",inside:t.languages.javascript},"class-name":{pattern:/((?:^|[:;])[ \t]*)(?!\d)\w+(?=[ \t]*\{|[ \t]+on\b)/m,lookbehind:!0},property:[{pattern:/((?:^|[;{])[ \t]*)(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,lookbehind:!0},{pattern:/((?:^|[;{])[ \t]*)property[ \t]+(?!\d)\w+(?:\.\w+)*[ \t]+(?!\d)\w+(?:\.\w+)*(?=[ \t]*:)/m,lookbehind:!0,inside:{keyword:/^property/,property:/\w+(?:\.\w+)*/}}],"javascript-expression":{pattern:RegExp(/(:[ \t]*)(?![\s;}[])(?:(?!$|[;}])<js>)+/.source.replace(/<js>/g,function(){return s}),"m"),lookbehind:!0,greedy:!0,alias:"language-javascript",inside:t.languages.javascript},string:{pattern:/"(?:\\.|[^\\"\r\n])*"/,greedy:!0},keyword:/\b(?:as|import|on)\b/,punctuation:/[{}[\]:;,]/}})(e)}rg.displayName="qore";rg.aliases=[];function rg(e){e.register(rt),e.languages.qore=e.languages.extend("clike",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:\/\/|#).*)/,lookbehind:!0},string:{pattern:/("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},keyword:/\b(?:abstract|any|assert|binary|bool|boolean|break|byte|case|catch|char|class|code|const|continue|data|default|do|double|else|enum|extends|final|finally|float|for|goto|hash|if|implements|import|inherits|instanceof|int|interface|long|my|native|new|nothing|null|object|our|own|private|reference|rethrow|return|short|soft(?:bool|date|float|int|list|number|string)|static|strictfp|string|sub|super|switch|synchronized|this|throw|throws|transient|try|void|volatile|while)\b/,boolean:/\b(?:false|true)\b/i,function:/\$?\b(?!\d)\w+(?=\()/,number:/\b(?:0b[01]+|0x(?:[\da-f]*\.)?[\da-fp\-]+|(?:\d+(?:\.\d+)?|\.\d+)(?:e\d+)?[df]|(?:\d+(?:\.\d+)?|\.\d+))\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|[!=](?:==?|~)?|>>?=?|<(?:=>?|<=?)?|&[&=]?|\|[|=]?|[*\/%^]=?|[~?])/,lookbehind:!0},variable:/\$(?!\d)\w+\b/})}sg.displayName="racket";sg.aliases=["rkt"];function sg(e){e.register(Ki),e.languages.racket=e.languages.extend("scheme",{"lambda-parameter":{pattern:/([(\[]lambda\s+[(\[])[^()\[\]'\s]+/,lookbehind:!0}}),e.languages.insertBefore("racket","string",{lang:{pattern:/^#lang.+/m,greedy:!0,alias:"keyword"}}),e.languages.rkt=e.languages.racket}ag.displayName="cshtml";ag.aliases=["razor"];function ag(e){e.register(fs),e.register(rn),(function(t){var n=/\/(?![/*])|\/\/.*[\r\n]|\/\*[^*]*(?:\*(?!\/)[^*]*)*\*\//.source,r=/@(?!")|"(?:[^\r\n\\"]|\\.)*"|@"(?:[^\\"]|""|\\[\s\S])*"(?!")/.source+"|"+/'(?:(?:[^\r\n'\\]|\\.|\\[Uux][\da-fA-F]{1,8})'|(?=[^\\](?!')))/.source;function s(v,S){for(var A=0;A<S;A++)v=v.replace(/<self>/g,function(){return"(?:"+v+")"});return v.replace(/<self>/g,"[^\\s\\S]").replace(/<str>/g,"(?:"+r+")").replace(/<comment>/g,"(?:"+n+")")}var i=s(/\((?:[^()'"@/]|<str>|<comment>|<self>)*\)/.source,2),o=s(/\[(?:[^\[\]'"@/]|<str>|<comment>|<self>)*\]/.source,1),l=s(/\{(?:[^{}'"@/]|<str>|<comment>|<self>)*\}/.source,2),u=s(/<(?:[^<>'"@/]|<comment>|<self>)*>/.source,1),c=/@/.source+/(?:await\b\s*)?/.source+"(?:"+/(?!await\b)\w+\b/.source+"|"+i+")(?:"+/[?!]?\.\w+\b/.source+"|(?:"+u+")?"+i+"|"+o+")*"+/(?![?!\.(\[]|<(?!\/))/.source,d=/@(?![\w()])/.source+"|"+c,p="(?:"+/"[^"@]*"|'[^'@]*'|[^\s'"@>=]+(?=[\s>])/.source+`|["'][^"'@]*(?:(?:`+d+`)[^"'@]*)+["'])`,f=/(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*<tagAttrValue>|(?=[\s/>])))+)?/.source.replace(/<tagAttrValue>/,p),m=/(?!\d)[^\s>\/=$<%]+/.source+f+/\s*\/?>/.source,b=/\B@?/.source+"(?:"+/<([a-zA-Z][\w:]*)/.source+f+/\s*>/.source+"(?:"+(/[^<]/.source+"|"+/<\/?(?!\1\b)/.source+m+"|"+s(/<\1/.source+f+/\s*>/.source+"(?:"+(/[^<]/.source+"|"+/<\/?(?!\1\b)/.source+m+"|<self>")+")*"+/<\/\1\s*>/.source,2))+")*"+/<\/\1\s*>/.source+"|"+/</.source+m+")";t.languages.cshtml=t.languages.extend("markup",{});var x=t.languages.insertBefore("csharp","string",{html:{pattern:RegExp(b),greedy:!0,inside:t.languages.cshtml}},{csharp:t.languages.extend("csharp",{})}),y={pattern:/\S[\s\S]*/,alias:"language-csharp",inside:x},E={pattern:RegExp(/(^|[^@])/.source+c),lookbehind:!0,greedy:!0,alias:"variable",inside:{keyword:/^@/,csharp:y}};t.languages.cshtml.tag.pattern=RegExp(/<\/?/.source+m),t.languages.cshtml.tag.inside["attr-value"].pattern=RegExp(/=\s*/.source+p),t.languages.insertBefore("inside","punctuation",{value:E},t.languages.cshtml.tag.inside["attr-value"]),t.languages.insertBefore("cshtml","prolog",{"razor-comment":{pattern:/@\*[\s\S]*?\*@/,greedy:!0,alias:"comment"},block:{pattern:RegExp(/(^|[^@])@/.source+"(?:"+[l,/(?:code|functions)\s*/.source+l,/(?:for|foreach|lock|switch|using|while)\s*/.source+i+/\s*/.source+l,/do\s*/.source+l+/\s*while\s*/.source+i+/(?:\s*;)?/.source,/try\s*/.source+l+/\s*catch\s*/.source+i+/\s*/.source+l+/\s*finally\s*/.source+l,/if\s*/.source+i+/\s*/.source+l+"(?:"+/\s*else/.source+"(?:"+/\s+if\s*/.source+i+")?"+/\s*/.source+l+")*",/helper\s+\w+\s*/.source+i+/\s*/.source+l].join("|")+")"),lookbehind:!0,greedy:!0,inside:{keyword:/^@\w*/,csharp:y}},directive:{pattern:/^([ \t]*)@(?:addTagHelper|attribute|implements|inherits|inject|layout|model|namespace|page|preservewhitespace|removeTagHelper|section|tagHelperPrefix|using)(?=\s).*/m,lookbehind:!0,greedy:!0,inside:{keyword:/^@\w+/,csharp:y}},value:E,"delegate-operator":{pattern:/(^|[^@])@(?=<)/,lookbehind:!0,alias:"operator"}}),t.languages.razor=t.languages.cshtml})(e)}xu.displayName="jsx";xu.aliases=[];function xu(e){e.register(cn),e.register(rn),(function(t){var n=t.util.clone(t.languages.javascript),r=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,s=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,i=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function o(c,d){return c=c.replace(/<S>/g,function(){return r}).replace(/<BRACES>/g,function(){return s}).replace(/<SPREAD>/g,function(){return i}),RegExp(c,d)}i=o(i).source,t.languages.jsx=t.languages.extend("markup",n),t.languages.jsx.tag.pattern=o(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=n.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:o(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:o(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var l=function(c){return c?typeof c=="string"?c:typeof c.content=="string"?c.content:c.content.map(l).join(""):""},u=function(c){for(var d=[],p=0;p<c.length;p++){var f=c[p],m=!1;if(typeof f!="string"&&(f.type==="tag"&&f.content[0]&&f.content[0].type==="tag"?f.content[0].content[0].content==="</"?d.length>0&&d[d.length-1].tagName===l(f.content[0].content[1])&&d.pop():f.content[f.content.length-1].content==="/>"||d.push({tagName:l(f.content[0].content[1]),openedBraces:0}):d.length>0&&f.type==="punctuation"&&f.content==="{"?d[d.length-1].openedBraces++:d.length>0&&d[d.length-1].openedBraces>0&&f.type==="punctuation"&&f.content==="}"?d[d.length-1].openedBraces--:m=!0),(m||typeof f=="string")&&d.length>0&&d[d.length-1].openedBraces===0){var b=l(f);p<c.length-1&&(typeof c[p+1]=="string"||c[p+1].type==="plain-text")&&(b+=l(c[p+1]),c.splice(p+1,1)),p>0&&(typeof c[p-1]=="string"||c[p-1].type==="plain-text")&&(b=l(c[p-1])+b,c.splice(p-1,1),p--),c[p]=new t.Token("plain-text",b,null,b)}f.content&&typeof f.content!="string"&&u(f.content)}};t.hooks.add("after-tokenize",function(c){c.language!=="jsx"&&c.language!=="tsx"||u(c.tokens)})})(e)}ig.displayName="tsx";ig.aliases=[];function ig(e){e.register(xu),e.register(ma),(function(t){var n=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",n),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var r=t.languages.tsx.tag;r.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+r.pattern.source+")",r.pattern.flags),r.lookbehind=!0})(e)}og.displayName="reason";og.aliases=[];function og(e){e.register(rt),e.languages.reason=e.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),e.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete e.languages.reason.function}lg.displayName="rego";lg.aliases=[];function lg(e){e.languages.rego={comment:/#.*/,property:{pattern:/(^|[^\\.])(?:"(?:\\.|[^\\"\r\n])*"|`[^`]*`|\b[a-z_]\w*\b)(?=\s*:(?!=))/i,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:as|default|else|import|not|null|package|set(?=\s*\()|some|with)\b/,boolean:/\b(?:false|true)\b/,function:{pattern:/\b[a-z_]\w*\b(?:\s*\.\s*\b[a-z_]\w*\b)*(?=\s*\()/i,inside:{namespace:/\b\w+\b(?=\s*\.)/,punctuation:/\./}},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,operator:/[-+*/%|&]|[<>:=]=?|!=|\b_\b/,punctuation:/[,;.\[\]{}()]/}}ug.displayName="renpy";ug.aliases=["rpy"];function ug(e){e.languages.renpy={comment:{pattern:/(^|[^\\])#.+/,lookbehind:!0},string:{pattern:/("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\])*\2|(?:^#?(?:(?:[0-9a-fA-F]){3}|[0-9a-fA-F]{6})$)/m,greedy:!0},function:/\b[a-z_]\w*(?=\()/i,property:/\b(?:Update|UpdateVersion|action|activate_sound|adv_nvl_transition|after_load_transition|align|alpha|alt|anchor|antialias|area|auto|background|bar_invert|bar_resizing|bar_vertical|black_color|bold|bottom_bar|bottom_gutter|bottom_margin|bottom_padding|box_reverse|box_wrap|can_update|caret|child|color|crop|default_afm_enable|default_afm_time|default_fullscreen|default_text_cps|developer|directory_name|drag_handle|drag_joined|drag_name|drag_raise|draggable|dragged|drop_shadow|drop_shadow_color|droppable|dropped|easein|easeout|edgescroll|end_game_transition|end_splash_transition|enter_replay_transition|enter_sound|enter_transition|enter_yesno_transition|executable_name|exit_replay_transition|exit_sound|exit_transition|exit_yesno_transition|fadein|fadeout|first_indent|first_spacing|fit_first|focus|focus_mask|font|foreground|game_main_transition|get_installed_packages|google_play_key|google_play_salt|ground|has_music|has_sound|has_voice|height|help|hinting|hover|hover_background|hover_color|hover_sound|hovered|hyperlink_functions|idle|idle_color|image_style|include_update|insensitive|insensitive_background|insensitive_color|inside|intra_transition|italic|justify|kerning|keyboard_focus|language|layer_clipping|layers|layout|left_bar|left_gutter|left_margin|left_padding|length|line_leading|line_overlap_split|line_spacing|linear|main_game_transition|main_menu_music|maximum|min_width|minimum|minwidth|modal|mouse|mousewheel|name|narrator_menu|newline_indent|nvl_adv_transition|offset|order_reverse|outlines|overlay_functions|pos|position|prefix|radius|range|rest_indent|right_bar|right_gutter|right_margin|right_padding|rotate|rotate_pad|ruby_style|sample_sound|save_directory|say_attribute_transition|screen_height|screen_width|scrollbars|selected_hover|selected_hover_color|selected_idle|selected_idle_color|selected_insensitive|show_side_image|show_two_window|side_spacing|side_xpos|side_ypos|size|size_group|slow_cps|slow_cps_multiplier|spacing|strikethrough|subpixel|text_align|text_style|text_xpos|text_y_fudge|text_ypos|thumb|thumb_offset|thumb_shadow|thumbnail_height|thumbnail_width|time|top_bar|top_gutter|top_margin|top_padding|translations|underline|unscrollable|update|value|version|version_name|version_tuple|vertical|width|window_hide_transition|window_icon|window_left_padding|window_show_transition|window_title|windows_icon|xadjustment|xalign|xanchor|xanchoraround|xaround|xcenter|xfill|xinitial|xmargin|xmaximum|xminimum|xoffset|xofsset|xpadding|xpos|xsize|xzoom|yadjustment|yalign|yanchor|yanchoraround|yaround|ycenter|yfill|yinitial|ymargin|ymaximum|yminimum|yoffset|ypadding|ypos|ysize|ysizexysize|yzoom|zoom|zorder)\b/,tag:/\b(?:bar|block|button|buttoscreenn|drag|draggroup|fixed|frame|grid|[hv]box|hotbar|hotspot|image|imagebutton|imagemap|input|key|label|menu|mm_menu_frame|mousearea|nvl|parallel|screen|self|side|tag|text|textbutton|timer|vbar|viewport|window)\b|\$/,keyword:/\b(?:None|add|adjustment|alignaround|allow|angle|animation|around|as|assert|behind|box_layout|break|build|cache|call|center|changed|child_size|choice|circles|class|clear|clicked|clipping|clockwise|config|contains|continue|corner1|corner2|counterclockwise|def|default|define|del|delay|disabled|disabled_text|dissolve|elif|else|event|except|exclude|exec|expression|fade|finally|for|from|function|global|gm_root|has|hide|id|if|import|in|init|is|jump|knot|lambda|left|less_rounded|mm_root|movie|music|null|on|onlayer|pass|pause|persistent|play|print|python|queue|raise|random|renpy|repeat|return|right|rounded_window|scene|scope|set|show|slow|slow_abortable|slow_done|sound|stop|store|style|style_group|substitute|suffix|theme|transform|transform_anchor|transpose|try|ui|unhovered|updater|use|voice|while|widget|widget_hover|widget_selected|widget_text|yield)\b/,boolean:/\b(?:[Ff]alse|[Tt]rue)\b/,number:/(?:\b(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?)|\B\.\d+)(?:e[+-]?\d+)?j?/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:and|at|not|or|with)\b/,punctuation:/[{}[\];(),.:]/},e.languages.rpy=e.languages.renpy}cg.displayName="rescript";cg.aliases=["res"];function cg(e){e.languages.rescript={comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},char:{pattern:/'(?:[^\r\n\\]|\\(?:.|\w+))'/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*|@[a-z.]*|#[A-Za-z]\w*|#\d/,function:{pattern:/[a-zA-Z]\w*(?=\()|(\.)[a-z]\w*/,lookbehind:!0},number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,boolean:/\b(?:false|true)\b/,"attr-value":/[A-Za-z]\w*(?==)/,constant:{pattern:/(\btype\s+)[a-z]\w*/,lookbehind:!0},tag:{pattern:/(<)[a-z]\w*|(?:<\/)[a-z]\w*/,lookbehind:!0,inside:{operator:/<|>|\//}},keyword:/\b(?:and|as|assert|begin|bool|class|constraint|do|done|downto|else|end|exception|external|float|for|fun|function|if|in|include|inherit|initializer|int|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|string|switch|then|to|try|type|when|while|with)\b/,operator:/\.{3}|:[:=]?|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/,punctuation:/[(){}[\],;.]/},e.languages.insertBefore("rescript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"tag"},rest:e.languages.rescript}},string:/[\s\S]+/}}}),e.languages.res=e.languages.rescript}dg.displayName="rest";dg.aliases=[];function dg(e){e.languages.rest={table:[{pattern:/(^[\t ]*)(?:\+[=-]+)+\+(?:\r?\n|\r)(?:\1[+|].+[+|](?:\r?\n|\r))+\1(?:\+[=-]+)+\+/m,lookbehind:!0,inside:{punctuation:/\||(?:\+[=-]+)+\+/}},{pattern:/(^[\t ]*)=+ [ =]*=(?:(?:\r?\n|\r)\1.+)+(?:\r?\n|\r)\1=+ [ =]*=(?=(?:\r?\n|\r){2}|\s*$)/m,lookbehind:!0,inside:{punctuation:/[=-]+/}}],"substitution-def":{pattern:/(^[\t ]*\.\. )\|(?:[^|\s](?:[^|]*[^|\s])?)\| [^:]+::/m,lookbehind:!0,inside:{substitution:{pattern:/^\|(?:[^|\s]|[^|\s][^|]*[^|\s])\|/,alias:"attr-value",inside:{punctuation:/^\||\|$/}},directive:{pattern:/( )(?! )[^:]+::/,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}}}},"link-target":[{pattern:/(^[\t ]*\.\. )\[[^\]]+\]/m,lookbehind:!0,alias:"string",inside:{punctuation:/^\[|\]$/}},{pattern:/(^[\t ]*\.\. )_(?:`[^`]+`|(?:[^:\\]|\\.)+):/m,lookbehind:!0,alias:"string",inside:{punctuation:/^_|:$/}}],directive:{pattern:/(^[\t ]*\.\. )[^:]+::/m,lookbehind:!0,alias:"function",inside:{punctuation:/::$/}},comment:{pattern:/(^[\t ]*\.\.)(?:(?: .+)?(?:(?:\r?\n|\r).+)+| .+)(?=(?:\r?\n|\r){2}|$)/m,lookbehind:!0},title:[{pattern:/^(([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+)(?:\r?\n|\r).+(?:\r?\n|\r)\1$/m,inside:{punctuation:/^[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+|[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}},{pattern:/(^|(?:\r?\n|\r){2}).+(?:\r?\n|\r)([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2+(?=\r?\n|\r|$)/,lookbehind:!0,inside:{punctuation:/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]+$/,important:/.+/}}],hr:{pattern:/((?:\r?\n|\r){2})([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\2{3,}(?=(?:\r?\n|\r){2})/,lookbehind:!0,alias:"punctuation"},field:{pattern:/(^[\t ]*):[^:\r\n]+:(?= )/m,lookbehind:!0,alias:"attr-name"},"command-line-option":{pattern:/(^[\t ]*)(?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?(?:, (?:[+-][a-z\d]|(?:--|\/)[a-z\d-]+)(?:[ =](?:[a-z][\w-]*|<[^<>]+>))?)*(?=(?:\r?\n|\r)? {2,}\S)/im,lookbehind:!0,alias:"symbol"},"literal-block":{pattern:/::(?:\r?\n|\r){2}([ \t]+)(?![ \t]).+(?:(?:\r?\n|\r)\1.+)*/,inside:{"literal-block-punctuation":{pattern:/^::/,alias:"punctuation"}}},"quoted-literal-block":{pattern:/::(?:\r?\n|\r){2}([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~]).*(?:(?:\r?\n|\r)\1.*)*/,inside:{"literal-block-punctuation":{pattern:/^(?:::|([!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~])\1*)/m,alias:"punctuation"}}},"list-bullet":{pattern:/(^[\t ]*)(?:[*+\-•‣⁃]|\(?(?:\d+|[a-z]|[ivxdclm]+)\)|(?:\d+|[a-z]|[ivxdclm]+)\.)(?= )/im,lookbehind:!0,alias:"punctuation"},"doctest-block":{pattern:/(^[\t ]*)>>> .+(?:(?:\r?\n|\r).+)*/m,lookbehind:!0,inside:{punctuation:/^>>>/}},inline:[{pattern:/(^|[\s\-:\/'"<(\[{])(?::[^:]+:`.*?`|`.*?`:[^:]+:|(\*\*?|``?|\|)(?!\s)(?:(?!\2).)*\S\2(?=[\s\-.,:;!?\\\/'")\]}]|$))/m,lookbehind:!0,inside:{bold:{pattern:/(^\*\*).+(?=\*\*$)/,lookbehind:!0},italic:{pattern:/(^\*).+(?=\*$)/,lookbehind:!0},"inline-literal":{pattern:/(^``).+(?=``$)/,lookbehind:!0,alias:"symbol"},role:{pattern:/^:[^:]+:|:[^:]+:$/,alias:"function",inside:{punctuation:/^:|:$/}},"interpreted-text":{pattern:/(^`).+(?=`$)/,lookbehind:!0,alias:"attr-value"},substitution:{pattern:/(^\|).+(?=\|$)/,lookbehind:!0,alias:"attr-value"},punctuation:/\*\*?|``?|\|/}}],link:[{pattern:/\[[^\[\]]+\]_(?=[\s\-.,:;!?\\\/'")\]}]|$)/,alias:"string",inside:{punctuation:/^\[|\]_$/}},{pattern:/(?:\b[a-z\d]+(?:[_.:+][a-z\d]+)*_?_|`[^`]+`_?_|_`[^`]+`)(?=[\s\-.,:;!?\\\/'")\]}]|$)/i,alias:"string",inside:{punctuation:/^_?`|`$|`?_?_$/}}],punctuation:{pattern:/(^[\t ]*)(?:\|(?= |$)|(?:---?|—|\.\.|__)(?= )|\.\.$)/m,lookbehind:!0}}}pg.displayName="rip";pg.aliases=[];function pg(e){e.languages.rip={comment:{pattern:/#.*/,greedy:!0},char:{pattern:/\B`[^\s`'",.:;#\/\\()<>\[\]{}]\b/,greedy:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},regex:{pattern:/(^|[^/])\/(?!\/)(?:\[[^\n\r\]]*\]|\\.|[^/\\\r\n\[])+\/(?=\s*(?:$|[\r\n,.;})]))/,lookbehind:!0,greedy:!0},keyword:/(?:=>|->)|\b(?:case|catch|class|else|exit|finally|if|raise|return|switch|try)\b/,builtin:/@|\bSystem\b/,boolean:/\b(?:false|true)\b/,date:/\b\d{4}-\d{2}-\d{2}\b/,time:/\b\d{2}:\d{2}:\d{2}\b/,datetime:/\b\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\b/,symbol:/:[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/,number:/[+-]?\b(?:\d+\.\d+|\d+)\b/,punctuation:/(?:\.{2,3})|[`,.:;=\/\\()<>\[\]{}]/,reference:/[^\d\s`'",.:;#\/\\()<>\[\]{}][^\s`'",.:;#\/\\()<>\[\]{}]*/}}fg.displayName="roboconf";fg.aliases=[];function fg(e){e.languages.roboconf={comment:/#.*/,keyword:{pattern:/(^|\s)(?:(?:external|import)\b|(?:facet|instance of)(?=[ \t]+[\w-]+[ \t]*\{))/,lookbehind:!0},component:{pattern:/[\w-]+(?=[ \t]*\{)/,alias:"variable"},property:/[\w.-]+(?=[ \t]*:)/,value:{pattern:/(=[ \t]*(?![ \t]))[^,;]+/,lookbehind:!0,alias:"attr-value"},optional:{pattern:/\(optional\)/,alias:"builtin"},wildcard:{pattern:/(\.)\*/,lookbehind:!0,alias:"operator"},punctuation:/[{},.;:=]/}}mg.displayName="robotframework";mg.aliases=["robot"];function mg(e){(function(t){var n={pattern:/(^[ \t]*| {2}|\t)#.*/m,lookbehind:!0,greedy:!0},r={pattern:/((?:^|[^\\])(?:\\{2})*)[$@&%]\{(?:[^{}\r\n]|\{[^{}\r\n]*\})*\}/,lookbehind:!0,inside:{punctuation:/^[$@&%]\{|\}$/}};function s(u,c){var d={};d["section-header"]={pattern:/^ ?\*{3}.+?\*{3}/,alias:"keyword"};for(var p in c)d[p]=c[p];return d.tag={pattern:/([\r\n](?: {2}|\t)[ \t]*)\[[-\w]+\]/,lookbehind:!0,inside:{punctuation:/\[|\]/}},d.variable=r,d.comment=n,{pattern:RegExp(/^ ?\*{3}[ \t]*<name>[ \t]*\*{3}(?:.|[\r\n](?!\*{3}))*/.source.replace(/<name>/g,function(){return u}),"im"),alias:"section",inside:d}}var i={pattern:/(\[Documentation\](?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,lookbehind:!0,alias:"string"},o={pattern:/([\r\n] ?)(?!#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0,alias:"function",inside:{variable:r}},l={pattern:/([\r\n](?: {2}|\t)[ \t]*)(?!\[|\.{3}|#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0,inside:{variable:r}};t.languages.robotframework={settings:s("Settings",{documentation:{pattern:/([\r\n] ?Documentation(?: {2}|\t)[ \t]*)(?![ \t]|#)(?:.|(?:\r\n?|\n)[ \t]*\.{3})+/,lookbehind:!0,alias:"string"},property:{pattern:/([\r\n] ?)(?!\.{3}|#)(?:\S(?:[ \t]\S)*)+/,lookbehind:!0}}),variables:s("Variables"),"test-cases":s("Test Cases",{"test-name":o,documentation:i,property:l}),keywords:s("Keywords",{"keyword-name":o,documentation:i,property:l}),tasks:s("Tasks",{"task-name":o,documentation:i,property:l}),comment:n},t.languages.robot=t.languages.robotframework})(e)}hg.displayName="sas";hg.aliases=[];function hg(e){(function(t){var n=/(?:"(?:""|[^"])*"(?!")|'(?:''|[^'])*'(?!'))/.source,r=/\b(?:\d[\da-f]*x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,s={pattern:RegExp(n+"[bx]"),alias:"number"},i={pattern:/&[a-z_]\w*/i},o={pattern:/((?:^|\s|=|\())%(?:ABORT|BY|CMS|COPY|DISPLAY|DO|ELSE|END|EVAL|GLOBAL|GO|GOTO|IF|INC|INCLUDE|INDEX|INPUT|KTRIM|LENGTH|LET|LIST|LOCAL|PUT|QKTRIM|QSCAN|QSUBSTR|QSYSFUNC|QUPCASE|RETURN|RUN|SCAN|SUBSTR|SUPERQ|SYMDEL|SYMEXIST|SYMGLOBL|SYMLOCAL|SYSCALL|SYSEVALF|SYSEXEC|SYSFUNC|SYSGET|SYSRPUT|THEN|TO|TSO|UNQUOTE|UNTIL|UPCASE|WHILE|WINDOW)\b/i,lookbehind:!0,alias:"keyword"},l={pattern:/(^|\s)(?:proc\s+\w+|data(?!=)|quit|run)\b/i,alias:"keyword",lookbehind:!0},u=[/\/\*[\s\S]*?\*\//,{pattern:/(^[ \t]*|;\s*)\*[^;]*;/m,lookbehind:!0}],c={pattern:RegExp(n),greedy:!0},d=/[$%@.(){}\[\];,\\]/,p={pattern:/%?\b\w+(?=\()/,alias:"keyword"},f={function:p,"arg-value":{pattern:/(=\s*)[A-Z\.]+/i,lookbehind:!0},operator:/=/,"macro-variable":i,arg:{pattern:/[A-Z]+/i,alias:"keyword"},number:r,"numeric-constant":s,punctuation:d,string:c},m={pattern:/\b(?:format|put)\b=?[\w'$.]+/i,inside:{keyword:/^(?:format|put)(?==)/i,equals:/=/,format:{pattern:/(?:\w|\$\d)+\.\d?/,alias:"number"}}},b={pattern:/\b(?:format|put)\s+[\w']+(?:\s+[$.\w]+)+(?=;)/i,inside:{keyword:/^(?:format|put)/i,format:{pattern:/[\w$]+\.\d?/,alias:"number"}}},x={pattern:/((?:^|\s)=?)(?:catname|checkpoint execute_always|dm|endsas|filename|footnote|%include|libname|%list|lock|missing|options|page|resetline|%run|sasfile|skip|sysecho|title\d?)\b/i,lookbehind:!0,alias:"keyword"},y={pattern:/(^|\s)(?:submit(?:\s+(?:load|norun|parseonly))?|endsubmit)\b/i,lookbehind:!0,alias:"keyword"},E=/aStore|accessControl|aggregation|audio|autotune|bayesianNetClassifier|bioMedImage|boolRule|builtins|cardinality|cdm|clustering|conditionalRandomFields|configuration|copula|countreg|dataDiscovery|dataPreprocess|dataSciencePilot|dataStep|decisionTree|deduplication|deepLearn|deepNeural|deepRnn|ds2|ecm|entityRes|espCluster|explainModel|factmac|fastKnn|fcmpact|fedSql|freqTab|gVarCluster|gam|gleam|graphSemiSupLearn|hiddenMarkovModel|hyperGroup|ica|image|iml|kernalPca|langModel|ldaTopic|loadStreams|mbc|mixed|mlTools|modelPublishing|network|neuralNet|nmf|nonParametricBayes|nonlinear|optNetwork|optimization|panel|pca|percentile|phreg|pls|qkb|qlim|quantreg|recommend|regression|reinforcementLearn|robustPca|ruleMining|sampling|sandwich|sccasl|search(?:Analytics)?|sentimentAnalysis|sequence|session(?:Prop)?|severity|simSystem|simple|smartData|sparkEmbeddedProcess|sparseML|spatialreg|spc|stabilityMonitoring|svDataDescription|svm|table|text(?:Filters|Frequency|Mining|Parse|Rule(?:Develop|Score)|Topic|Util)|timeData|transpose|tsInfo|tsReconcile|uniTimeSeries|varReduce/.source,v={pattern:RegExp(/(^|\s)(?:action\s+)?(?:<act>)\.[a-z]+\b[^;]+/.source.replace(/<act>/g,function(){return E}),"i"),lookbehind:!0,inside:{keyword:RegExp(/(?:<act>)\.[a-z]+\b/.source.replace(/<act>/g,function(){return E}),"i"),action:{pattern:/(?:action)/i,alias:"keyword"},comment:u,function:p,"arg-value":f["arg-value"],operator:f.operator,argument:f.arg,number:r,"numeric-constant":s,punctuation:d,string:c}},S={pattern:/((?:^|\s)=?)(?:after|analysis|and|array|barchart|barwidth|begingraph|by|call|cas|cbarline|cfill|class(?:lev)?|close|column|computed?|contains|continue|data(?==)|define|delete|describe|document|do\s+over|do|dol|drop|dul|else|end(?:comp|source)?|entryTitle|eval(?:uate)?|exec(?:ute)?|exit|file(?:name)?|fill(?:attrs)?|flist|fnc|function(?:list)?|global|goto|group(?:by)?|headline|headskip|histogram|if|infile|keep|keylabel|keyword|label|layout|leave|legendlabel|length|libname|loadactionset|merge|midpoints|_?null_|name|noobs|nowd|ods|options|or|otherwise|out(?:put)?|over(?:lay)?|plot|print|put|raise|ranexp|rannor|rbreak|retain|return|select|session|sessref|set|source|statgraph|sum|summarize|table|temp|terminate|then\s+do|then|title\d?|to|var|when|where|xaxisopts|y2axisopts|yaxisopts)\b/i,lookbehind:!0};t.languages.sas={datalines:{pattern:/^([ \t]*)(?:cards|(?:data)?lines);[\s\S]+?^[ \t]*;/im,lookbehind:!0,alias:"string",inside:{keyword:{pattern:/^(?:cards|(?:data)?lines)/i},punctuation:/;/}},"proc-sql":{pattern:/(^proc\s+(?:fed)?sql(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|data|quit|run);|(?![\s\S]))/im,lookbehind:!0,inside:{sql:{pattern:RegExp(/^[ \t]*(?:select|alter\s+table|(?:create|describe|drop)\s+(?:index|table(?:\s+constraints)?|view)|create\s+unique\s+index|insert\s+into|update)(?:<str>|[^;"'])+;/.source.replace(/<str>/g,function(){return n}),"im"),alias:"language-sql",inside:t.languages.sql},"global-statements":x,"sql-statements":{pattern:/(^|\s)(?:disconnect\s+from|begin|commit|exec(?:ute)?|reset|rollback|validate)\b/i,lookbehind:!0,alias:"keyword"},number:r,"numeric-constant":s,punctuation:d,string:c}},"proc-groovy":{pattern:/(^proc\s+groovy(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|data|quit|run);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,groovy:{pattern:RegExp(/(^[ \t]*submit(?:\s+(?:load|norun|parseonly))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(/<str>/g,function(){return n}),"im"),lookbehind:!0,alias:"language-groovy",inside:t.languages.groovy},keyword:S,"submit-statement":y,"global-statements":x,number:r,"numeric-constant":s,punctuation:d,string:c}},"proc-lua":{pattern:/(^proc\s+lua(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|data|quit|run);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,lua:{pattern:RegExp(/(^[ \t]*submit(?:\s+(?:load|norun|parseonly))?)(?:<str>|[^"'])+?(?=endsubmit;)/.source.replace(/<str>/g,function(){return n}),"im"),lookbehind:!0,alias:"language-lua",inside:t.languages.lua},keyword:S,"submit-statement":y,"global-statements":x,number:r,"numeric-constant":s,punctuation:d,string:c}},"proc-cas":{pattern:/(^proc\s+cas(?:\s+[\w|=]+)?;)[\s\S]+?(?=^(?:proc\s+\w+|quit|data);|(?![\s\S]))/im,lookbehind:!0,inside:{comment:u,"statement-var":{pattern:/((?:^|\s)=?)saveresult\s[^;]+/im,lookbehind:!0,inside:{statement:{pattern:/^saveresult\s+\S+/i,inside:{keyword:/^(?:saveresult)/i}},rest:f}},"cas-actions":v,statement:{pattern:/((?:^|\s)=?)(?:default|(?:un)?set|on|output|upload)[^;]+/im,lookbehind:!0,inside:f},step:l,keyword:S,function:p,format:m,altformat:b,"global-statements":x,number:r,"numeric-constant":s,punctuation:d,string:c}},"proc-args":{pattern:RegExp(/(^proc\s+\w+\s+)(?!\s)(?:[^;"']|<str>)+;/.source.replace(/<str>/g,function(){return n}),"im"),lookbehind:!0,inside:f},"macro-keyword":o,"macro-variable":i,"macro-string-functions":{pattern:/((?:^|\s|=))%(?:BQUOTE|NRBQUOTE|NRQUOTE|NRSTR|QUOTE|STR)\(.*?(?:[^%]\))/i,lookbehind:!0,inside:{function:{pattern:/%(?:BQUOTE|NRBQUOTE|NRQUOTE|NRSTR|QUOTE|STR)/i,alias:"keyword"},"macro-keyword":o,"macro-variable":i,"escaped-char":{pattern:/%['"()<>=¬^~;,#]/},punctuation:d}},"macro-declaration":{pattern:/^%macro[^;]+(?=;)/im,inside:{keyword:/%macro/i}},"macro-end":{pattern:/^%mend[^;]+(?=;)/im,inside:{keyword:/%mend/i}},macro:{pattern:/%_\w+(?=\()/,alias:"keyword"},input:{pattern:/\binput\s[-\w\s/*.$&]+;/i,inside:{input:{alias:"keyword",pattern:/^input/i},comment:u,number:r,"numeric-constant":s}},"options-args":{pattern:/(^options)[-'"|/\\<>*+=:()\w\s]*(?=;)/im,lookbehind:!0,inside:f},"cas-actions":v,comment:u,function:p,format:m,altformat:b,"numeric-constant":s,datetime:{pattern:RegExp(n+"(?:dt?|t)"),alias:"number"},string:c,step:l,keyword:S,"operator-keyword":{pattern:/\b(?:eq|ge|gt|in|le|lt|ne|not)\b/i,alias:"operator"},number:r,operator:/\*\*?|\|\|?|!!?|¦¦?|<[>=]?|>[<=]?|[-+\/=&]|[~¬^]=?/,punctuation:d}})(e)}gg.displayName="shell-session";gg.aliases=["sh-session","shellsession"];function gg(e){e.register($i),(function(t){var n=[/"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/.source,/'[^']*'/.source,/\$'(?:[^'\\]|\\[\s\S])*'/.source,/<<-?\s*(["']?)(\w+)\1\s[\s\S]*?[\r\n]\2/.source].join("|");t.languages["shell-session"]={command:{pattern:RegExp(/^/.source+"(?:"+(/[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+(?::[^\0-\x1F$#%*?"<>:;|]+)?/.source+"|"+/[/~.][^\0-\x1F$#%*?"<>@:;|]*/.source)+")?"+/[$#%](?=\s)/.source+/(?:[^\\\r\n \t'"<$]|[ \t](?:(?!#)|#.*$)|\\(?:[^\r]|\r\n?)|\$(?!')|<(?!<)|<<str>>)+/.source.replace(/<<str>>/g,function(){return n}),"m"),greedy:!0,inside:{info:{pattern:/^[^#$%]+/,alias:"punctuation",inside:{user:/^[^\s@:$#%*!/\\]+@[^\r\n@:$#%*!/\\]+/,punctuation:/:/,path:/[\s\S]+/}},bash:{pattern:/(^[$#%]\s*)\S[\s\S]*/,lookbehind:!0,alias:"language-bash",inside:t.languages.bash},"shell-symbol":{pattern:/^[$#%]/,alias:"important"}}},output:/.(?:.*(?:[\r\n]|.$))*/},t.languages["sh-session"]=t.languages.shellsession=t.languages["shell-session"]})(e)}bg.displayName="smali";bg.aliases=[];function bg(e){e.languages.smali={comment:/#.*/,string:{pattern:/"(?:[^\r\n\\"]|\\.)*"|'(?:[^\r\n\\']|\\(?:.|u[\da-fA-F]{4}))'/,greedy:!0},"class-name":{pattern:/(^|[^L])L(?:(?:\w+|`[^`\r\n]*`)\/)*(?:[\w$]+|`[^`\r\n]*`)(?=\s*;)/,lookbehind:!0,inside:{"class-name":{pattern:/(^L|\/)(?:[\w$]+|`[^`\r\n]*`)$/,lookbehind:!0},namespace:{pattern:/^(L)(?:(?:\w+|`[^`\r\n]*`)\/)+/,lookbehind:!0,inside:{punctuation:/\//}},builtin:/^L/}},builtin:[{pattern:/([();\[])[BCDFIJSVZ]+/,lookbehind:!0},{pattern:/([\w$>]:)[BCDFIJSVZ]/,lookbehind:!0}],keyword:[{pattern:/(\.end\s+)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])\.(?!\d)[\w-]+/,lookbehind:!0},{pattern:/(^|[^\w.-])(?:abstract|annotation|bridge|constructor|enum|final|interface|private|protected|public|runtime|static|synthetic|system|transient)(?![\w.-])/,lookbehind:!0}],function:{pattern:/(^|[^\w.-])(?:\w+|<[\w$-]+>)(?=\()/,lookbehind:!0},field:{pattern:/[\w$]+(?=:)/,alias:"variable"},register:{pattern:/(^|[^\w.-])[vp]\d(?![\w.-])/,lookbehind:!0,alias:"variable"},boolean:{pattern:/(^|[^\w.-])(?:false|true)(?![\w.-])/,lookbehind:!0},number:{pattern:/(^|[^/\w.-])-?(?:NAN|INFINITY|0x(?:[\dA-F]+(?:\.[\dA-F]*)?|\.[\dA-F]+)(?:p[+-]?[\dA-F]+)?|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)[dflst]?(?![\w.-])/i,lookbehind:!0},label:{pattern:/(:)\w+/,lookbehind:!0,alias:"property"},operator:/->|\.\.|[\[=]/,punctuation:/[{}(),;:]/}}xg.displayName="smalltalk";xg.aliases=[];function xg(e){e.languages.smalltalk={comment:{pattern:/"(?:""|[^"])*"/,greedy:!0},char:{pattern:/\$./,greedy:!0},string:{pattern:/'(?:''|[^'])*'/,greedy:!0},symbol:/#[\da-z]+|#(?:-|([+\/\\*~<>=@%|&?!])\1?)|#(?=\()/i,"block-arguments":{pattern:/(\[\s*):[^\[|]*\|/,lookbehind:!0,inside:{variable:/:[\da-z]+/i,punctuation:/\|/}},"temporary-variables":{pattern:/\|[^|]+\|/,inside:{variable:/[\da-z]+/i,punctuation:/\|/}},keyword:/\b(?:new|nil|self|super)\b/,boolean:/\b(?:false|true)\b/,number:[/\d+r-?[\dA-Z]+(?:\.[\dA-Z]+)?(?:e-?\d+)?/,/\b\d+(?:\.\d+)?(?:e-?\d+)?/],operator:/[<=]=?|:=|~[~=]|\/\/?|\\\\|>[>=]?|[!^+\-*&|,@]/,punctuation:/[.;:?\[\](){}]/}}yg.displayName="smarty";yg.aliases=[];function yg(e){e.register(dn),(function(t){t.languages.smarty={comment:{pattern:/^\{\*[\s\S]*?\*\}/,greedy:!0},"embedded-php":{pattern:/^\{php\}[\s\S]*?\{\/php\}/,greedy:!0,inside:{smarty:{pattern:/^\{php\}|\{\/php\}$/,inside:null},php:{pattern:/[\s\S]+/,alias:"language-php",inside:t.languages.php}}},string:[{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0,inside:{interpolation:{pattern:/\{[^{}]*\}|`[^`]*`/,inside:{"interpolation-punctuation":{pattern:/^[{`]|[`}]$/,alias:"punctuation"},expression:{pattern:/[\s\S]+/,inside:null}}},variable:/\$\w+/}},{pattern:/'(?:\\.|[^'\\\r\n])*'/,greedy:!0}],keyword:{pattern:/(^\{\/?)[a-z_]\w*\b(?!\()/i,lookbehind:!0,greedy:!0},delimiter:{pattern:/^\{\/?|\}$/,greedy:!0,alias:"punctuation"},number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,variable:[/\$(?!\d)\w+/,/#(?!\d)\w+#/,{pattern:/(\.|->|\w\s*=)(?!\d)\w+\b(?!\()/,lookbehind:!0},{pattern:/(\[)(?!\d)\w+(?=\])/,lookbehind:!0}],function:{pattern:/(\|\s*)@?[a-z_]\w*|\b[a-z_]\w*(?=\()/i,lookbehind:!0},"attr-name":/\b[a-z_]\w*(?=\s*=)/i,boolean:/\b(?:false|no|off|on|true|yes)\b/,punctuation:/[\[\](){}.,:`]|->/,operator:[/[+\-*\/%]|==?=?|[!<>]=?|&&|\|\|?/,/\bis\s+(?:not\s+)?(?:div|even|odd)(?:\s+by)?\b/,/\b(?:and|eq|gt?e|gt|lt?e|lt|mod|neq?|not|or)\b/]},t.languages.smarty["embedded-php"].inside.smarty.inside=t.languages.smarty,t.languages.smarty.string[0].inside.interpolation.inside.expression.inside=t.languages.smarty;var n=/"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,r=RegExp(/\{\*[\s\S]*?\*\}/.source+"|"+/\{php\}[\s\S]*?\{\/php\}/.source+"|"+/\{(?:[^{}"']|<str>|\{(?:[^{}"']|<str>|\{(?:[^{}"']|<str>)*\})*\})*\}/.source.replace(/<str>/g,function(){return n.source}),"g");t.hooks.add("before-tokenize",function(s){var i="{literal}",o="{/literal}",l=!1;t.languages["markup-templating"].buildPlaceholders(s,"smarty",r,function(u){return u===o&&(l=!1),l?!1:(u===i&&(l=!0),!0)})}),t.hooks.add("after-tokenize",function(s){t.languages["markup-templating"].tokenizePlaceholders(s,"smarty")})})(e)}Eg.displayName="sml";Eg.aliases=["smlnj"];function Eg(e){(function(t){var n=/\b(?:abstype|and|andalso|as|case|datatype|do|else|end|eqtype|exception|fn|fun|functor|handle|if|in|include|infix|infixr|let|local|nonfix|of|op|open|orelse|raise|rec|sharing|sig|signature|struct|structure|then|type|val|where|while|with|withtype)\b/i;t.languages.sml={comment:/\(\*(?:[^*(]|\*(?!\))|\((?!\*)|\(\*(?:[^*(]|\*(?!\))|\((?!\*))*\*\))*\*\)/,string:{pattern:/#?"(?:[^"\\]|\\.)*"/,greedy:!0},"class-name":[{pattern:RegExp(/((?:^|[^:]):\s*)<TERMINAL>(?:\s*(?:(?:\*|->)\s*<TERMINAL>|,\s*<TERMINAL>(?:(?=<NOT-LAST>)|(?!<NOT-LAST>)\s+<LONG-ID>)))*/.source.replace(/<NOT-LAST>/g,function(){return/\s*(?:[*,]|->)/.source}).replace(/<TERMINAL>/g,function(){return/(?:'[\w']*|<LONG-ID>|\((?:[^()]|\([^()]*\))*\)|\{(?:[^{}]|\{[^{}]*\})*\})(?:\s+<LONG-ID>)*/.source}).replace(/<LONG-ID>/g,function(){return/(?!<KEYWORD>)[a-z\d_][\w'.]*/.source}).replace(/<KEYWORD>/g,function(){return n.source}),"i"),lookbehind:!0,greedy:!0,inside:null},{pattern:/((?:^|[^\w'])(?:datatype|exception|functor|signature|structure|type)\s+)[a-z_][\w'.]*/i,lookbehind:!0}],function:{pattern:/((?:^|[^\w'])fun\s+)[a-z_][\w'.]*/i,lookbehind:!0},keyword:n,variable:{pattern:/(^|[^\w'])'[\w']*/,lookbehind:!0},number:/~?\b(?:\d+(?:\.\d+)?(?:e~?\d+)?|0x[\da-f]+)\b/i,word:{pattern:/\b0w(?:\d+|x[\da-f]+)\b/i,alias:"constant"},boolean:/\b(?:false|true)\b/i,operator:/\.\.\.|:[>=:]|=>?|->|[<>]=?|[!+\-*/^#|@~]/,punctuation:/[(){}\[\].:,;]/},t.languages.sml["class-name"][0].inside=t.languages.sml,t.languages.smlnj=t.languages.sml})(e)}Sg.displayName="solidity";Sg.aliases=["sol"];function Sg(e){e.register(rt),e.languages.solidity=e.languages.extend("clike",{"class-name":{pattern:/(\b(?:contract|enum|interface|library|new|struct|using)\s+)(?!\d)[\w$]+/,lookbehind:!0},keyword:/\b(?:_|anonymous|as|assembly|assert|break|calldata|case|constant|constructor|continue|contract|default|delete|do|else|emit|enum|event|external|for|from|function|if|import|indexed|inherited|interface|internal|is|let|library|mapping|memory|modifier|new|payable|pragma|private|public|pure|require|returns?|revert|selfdestruct|solidity|storage|struct|suicide|switch|this|throw|using|var|view|while)\b/,operator:/=>|->|:=|=:|\*\*|\+\+|--|\|\||&&|<<=?|>>=?|[-+*/%^&|<>!=]=?|[~?]/}),e.languages.insertBefore("solidity","keyword",{builtin:/\b(?:address|bool|byte|u?int(?:8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?|string|bytes(?:[1-9]|[12]\d|3[0-2])?)\b/}),e.languages.insertBefore("solidity","number",{version:{pattern:/([<>]=?|\^)\d+\.\d+\.\d+\b/,lookbehind:!0,alias:"number"}}),e.languages.sol=e.languages.solidity}Tg.displayName="solution-file";Tg.aliases=["sln"];function Tg(e){(function(t){var n={pattern:/\{[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}\}/i,alias:"constant",inside:{punctuation:/[{}]/}};t.languages["solution-file"]={comment:{pattern:/#.*/,greedy:!0},string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0,inside:{guid:n}},object:{pattern:/^([ \t]*)(?:([A-Z]\w*)\b(?=.*(?:\r\n?|\n)(?:\1[ \t].*(?:\r\n?|\n))*\1End\2(?=[ \t]*$))|End[A-Z]\w*(?=[ \t]*$))/m,lookbehind:!0,greedy:!0,alias:"keyword"},property:{pattern:/^([ \t]*)(?!\s)[^\r\n"#=()]*[^\s"#=()](?=\s*=)/m,lookbehind:!0,inside:{guid:n}},guid:n,number:/\b\d+(?:\.\d+)*\b/,boolean:/\b(?:FALSE|TRUE)\b/,operator:/=/,punctuation:/[(),]/},t.languages.sln=t.languages["solution-file"]})(e)}Ng.displayName="soy";Ng.aliases=[];function Ng(e){e.register(dn),(function(t){var n=/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,r=/\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b|\b0x[\dA-F]+\b/;t.languages.soy={comment:[/\/\*[\s\S]*?\*\//,{pattern:/(\s)\/\/.*/,lookbehind:!0,greedy:!0}],"command-arg":{pattern:/(\{+\/?\s*(?:alias|call|delcall|delpackage|deltemplate|namespace|template)\s+)\.?[\w.]+/,lookbehind:!0,alias:"string",inside:{punctuation:/\./}},parameter:{pattern:/(\{+\/?\s*@?param\??\s+)\.?[\w.]+/,lookbehind:!0,alias:"variable"},keyword:[{pattern:/(\{+\/?[^\S\r\n]*)(?:\\[nrt]|alias|call|case|css|default|delcall|delpackage|deltemplate|else(?:if)?|fallbackmsg|for(?:each)?|if(?:empty)?|lb|let|literal|msg|namespace|nil|@?param\??|rb|sp|switch|template|xid)/,lookbehind:!0},/\b(?:any|as|attributes|bool|css|float|html|in|int|js|list|map|null|number|string|uri)\b/],delimiter:{pattern:/^\{+\/?|\/?\}+$/,alias:"punctuation"},property:/\w+(?==)/,variable:{pattern:/\$[^\W\d]\w*(?:\??(?:\.\w+|\[[^\]]+\]))*/,inside:{string:{pattern:n,greedy:!0},number:r,punctuation:/[\[\].?]/}},string:{pattern:n,greedy:!0},function:[/\w+(?=\()/,{pattern:/(\|[^\S\r\n]*)\w+/,lookbehind:!0}],boolean:/\b(?:false|true)\b/,number:r,operator:/\?:?|<=?|>=?|==?|!=|[+*/%-]|\b(?:and|not|or)\b/,punctuation:/[{}()\[\]|.,:]/},t.hooks.add("before-tokenize",function(s){var i=/\{\{.+?\}\}|\{.+?\}|\s\/\/.*|\/\*[\s\S]*?\*\//g,o="{literal}",l="{/literal}",u=!1;t.languages["markup-templating"].buildPlaceholders(s,"soy",i,function(c){return c===l&&(u=!1),u?!1:(c===o&&(u=!0),!0)})}),t.hooks.add("after-tokenize",function(s){t.languages["markup-templating"].tokenizePlaceholders(s,"soy")})})(e)}yu.displayName="turtle";yu.aliases=["trig"];function yu(e){e.languages.turtle={comment:{pattern:/#.*/,greedy:!0},"multiline-string":{pattern:/"""(?:(?:""?)?(?:[^"\\]|\\.))*"""|'''(?:(?:''?)?(?:[^'\\]|\\.))*'''/,greedy:!0,alias:"string",inside:{comment:/#.*/}},string:{pattern:/"(?:[^\\"\r\n]|\\.)*"|'(?:[^\\'\r\n]|\\.)*'/,greedy:!0},url:{pattern:/<(?:[^\x00-\x20<>"{}|^`\\]|\\(?:u[\da-fA-F]{4}|U[\da-fA-F]{8}))*>/,greedy:!0,inside:{punctuation:/[<>]/}},function:{pattern:/(?:(?![-.\d\xB7])[-.\w\xB7\xC0-\uFFFD]+)?:(?:(?![-.])(?:[-.:\w\xC0-\uFFFD]|%[\da-f]{2}|\\.)+)?/i,inside:{"local-name":{pattern:/([^:]*:)[\s\S]+/,lookbehind:!0},prefix:{pattern:/[\s\S]+/,inside:{punctuation:/:/}}}},number:/[+-]?\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i,punctuation:/[{}.,;()[\]]|\^\^/,boolean:/\b(?:false|true)\b/,keyword:[/(?:\ba|@prefix|@base)\b|=/,/\b(?:base|graph|prefix)\b/i],tag:{pattern:/@[a-z]+(?:-[a-z\d]+)*/i,inside:{punctuation:/@/}}},e.languages.trig=e.languages.turtle}wg.displayName="sparql";wg.aliases=["rq"];function wg(e){e.register(yu),e.languages.sparql=e.languages.extend("turtle",{boolean:/\b(?:false|true)\b/i,variable:{pattern:/[?$]\w+/,greedy:!0}}),e.languages.insertBefore("sparql","punctuation",{keyword:[/\b(?:A|ADD|ALL|AS|ASC|ASK|BNODE|BY|CLEAR|CONSTRUCT|COPY|CREATE|DATA|DEFAULT|DELETE|DESC|DESCRIBE|DISTINCT|DROP|EXISTS|FILTER|FROM|GROUP|HAVING|INSERT|INTO|LIMIT|LOAD|MINUS|MOVE|NAMED|NOT|NOW|OFFSET|OPTIONAL|ORDER|RAND|REDUCED|SELECT|SEPARATOR|SERVICE|SILENT|STRUUID|UNION|USING|UUID|VALUES|WHERE)\b/i,/\b(?:ABS|AVG|BIND|BOUND|CEIL|COALESCE|CONCAT|CONTAINS|COUNT|DATATYPE|DAY|ENCODE_FOR_URI|FLOOR|GROUP_CONCAT|HOURS|IF|IRI|isBLANK|isIRI|isLITERAL|isNUMERIC|isURI|LANG|LANGMATCHES|LCASE|MAX|MD5|MIN|MINUTES|MONTH|REGEX|REPLACE|ROUND|sameTerm|SAMPLE|SECONDS|SHA1|SHA256|SHA384|SHA512|STR|STRAFTER|STRBEFORE|STRDT|STRENDS|STRLANG|STRLEN|STRSTARTS|SUBSTR|SUM|TIMEZONE|TZ|UCASE|URI|YEAR)\b(?=\s*\()/i,/\b(?:BASE|GRAPH|PREFIX)\b/i]}),e.languages.rq=e.languages.sparql}vg.displayName="splunk-spl";vg.aliases=[];function vg(e){e.languages["splunk-spl"]={comment:/`comment\("(?:\\.|[^\\"])*"\)`/,string:{pattern:/"(?:\\.|[^\\"])*"/,greedy:!0},keyword:/\b(?:abstract|accum|addcoltotals|addinfo|addtotals|analyzefields|anomalies|anomalousvalue|anomalydetection|append|appendcols|appendcsv|appendlookup|appendpipe|arules|associate|audit|autoregress|bin|bucket|bucketdir|chart|cluster|cofilter|collect|concurrency|contingency|convert|correlate|datamodel|dbinspect|dedup|delete|delta|diff|erex|eval|eventcount|eventstats|extract|fieldformat|fields|fieldsummary|filldown|fillnull|findtypes|folderize|foreach|format|from|gauge|gentimes|geom|geomfilter|geostats|head|highlight|history|iconify|input|inputcsv|inputlookup|iplocation|join|kmeans|kv|kvform|loadjob|localize|localop|lookup|makecontinuous|makemv|makeresults|map|mcollect|metadata|metasearch|meventcollect|mstats|multikv|multisearch|mvcombine|mvexpand|nomv|outlier|outputcsv|outputlookup|outputtext|overlap|pivot|predict|rangemap|rare|regex|relevancy|reltime|rename|replace|rest|return|reverse|rex|rtorder|run|savedsearch|script|scrub|search|searchtxn|selfjoin|sendemail|set|setfields|sichart|sirare|sistats|sitimechart|sitop|sort|spath|stats|strcat|streamstats|table|tags|tail|timechart|timewrap|top|transaction|transpose|trendline|tscollect|tstats|typeahead|typelearner|typer|union|uniq|untable|where|x11|xmlkv|xmlunescape|xpath|xyseries)\b/i,"operator-word":{pattern:/\b(?:and|as|by|not|or|xor)\b/i,alias:"operator"},function:/\b\w+(?=\s*\()/,property:/\b\w+(?=\s*=(?!=))/,date:{pattern:/\b\d{1,2}\/\d{1,2}\/\d{1,4}(?:(?::\d{1,2}){3})?\b/,alias:"number"},number:/\b\d+(?:\.\d+)?\b/,boolean:/\b(?:f|false|t|true)\b/i,operator:/[<>=]=?|[-+*/%|]/,punctuation:/[()[\],]/}}Ag.displayName="sqf";Ag.aliases=[];function Ag(e){e.register(rt),e.languages.sqf=e.languages.extend("clike",{string:{pattern:/"(?:(?:"")?[^"])*"(?!")|'(?:[^'])*'/,greedy:!0},keyword:/\b(?:breakOut|breakTo|call|case|catch|default|do|echo|else|execFSM|execVM|exitWith|for|forEach|forEachMember|forEachMemberAgent|forEachMemberTeam|from|goto|if|nil|preprocessFile|preprocessFileLineNumbers|private|scopeName|spawn|step|switch|then|throw|to|try|while|with)\b/i,boolean:/\b(?:false|true)\b/i,function:/\b(?:abs|accTime|acos|action|actionIDs|actionKeys|actionKeysImages|actionKeysNames|actionKeysNamesArray|actionName|actionParams|activateAddons|activatedAddons|activateKey|add3DENConnection|add3DENEventHandler|add3DENLayer|addAction|addBackpack|addBackpackCargo|addBackpackCargoGlobal|addBackpackGlobal|addCamShake|addCuratorAddons|addCuratorCameraArea|addCuratorEditableObjects|addCuratorEditingArea|addCuratorPoints|addEditorObject|addEventHandler|addForce|addForceGeneratorRTD|addGoggles|addGroupIcon|addHandgunItem|addHeadgear|addItem|addItemCargo|addItemCargoGlobal|addItemPool|addItemToBackpack|addItemToUniform|addItemToVest|addLiveStats|addMagazine|addMagazineAmmoCargo|addMagazineCargo|addMagazineCargoGlobal|addMagazineGlobal|addMagazinePool|addMagazines|addMagazineTurret|addMenu|addMenuItem|addMissionEventHandler|addMPEventHandler|addMusicEventHandler|addOwnedMine|addPlayerScores|addPrimaryWeaponItem|addPublicVariableEventHandler|addRating|addResources|addScore|addScoreSide|addSecondaryWeaponItem|addSwitchableUnit|addTeamMember|addToRemainsCollector|addTorque|addUniform|addVehicle|addVest|addWaypoint|addWeapon|addWeaponCargo|addWeaponCargoGlobal|addWeaponGlobal|addWeaponItem|addWeaponPool|addWeaponTurret|admin|agent|agents|AGLToASL|aimedAtTarget|aimPos|airDensityCurveRTD|airDensityRTD|airplaneThrottle|airportSide|AISFinishHeal|alive|all3DENEntities|allAirports|allControls|allCurators|allCutLayers|allDead|allDeadMen|allDisplays|allGroups|allMapMarkers|allMines|allMissionObjects|allow3DMode|allowCrewInImmobile|allowCuratorLogicIgnoreAreas|allowDamage|allowDammage|allowFileOperations|allowFleeing|allowGetIn|allowSprint|allPlayers|allSimpleObjects|allSites|allTurrets|allUnits|allUnitsUAV|allVariables|ammo|ammoOnPylon|animate|animateBay|animateDoor|animatePylon|animateSource|animationNames|animationPhase|animationSourcePhase|animationState|append|apply|armoryPoints|arrayIntersect|asin|ASLToAGL|ASLToATL|assert|assignAsCargo|assignAsCargoIndex|assignAsCommander|assignAsDriver|assignAsGunner|assignAsTurret|assignCurator|assignedCargo|assignedCommander|assignedDriver|assignedGunner|assignedItems|assignedTarget|assignedTeam|assignedVehicle|assignedVehicleRole|assignItem|assignTeam|assignToAirport|atan|atan2|atg|ATLToASL|attachedObject|attachedObjects|attachedTo|attachObject|attachTo|attackEnabled|backpack|backpackCargo|backpackContainer|backpackItems|backpackMagazines|backpackSpaceFor|behaviour|benchmark|binocular|blufor|boundingBox|boundingBoxReal|boundingCenter|briefingName|buildingExit|buildingPos|buldozer_EnableRoadDiag|buldozer_IsEnabledRoadDiag|buldozer_LoadNewRoads|buldozer_reloadOperMap|buttonAction|buttonSetAction|cadetMode|callExtension|camCommand|camCommit|camCommitPrepared|camCommitted|camConstuctionSetParams|camCreate|camDestroy|cameraEffect|cameraEffectEnableHUD|cameraInterest|cameraOn|cameraView|campaignConfigFile|camPreload|camPreloaded|camPrepareBank|camPrepareDir|camPrepareDive|camPrepareFocus|camPrepareFov|camPrepareFovRange|camPreparePos|camPrepareRelPos|camPrepareTarget|camSetBank|camSetDir|camSetDive|camSetFocus|camSetFov|camSetFovRange|camSetPos|camSetRelPos|camSetTarget|camTarget|camUseNVG|canAdd|canAddItemToBackpack|canAddItemToUniform|canAddItemToVest|cancelSimpleTaskDestination|canFire|canMove|canSlingLoad|canStand|canSuspend|canTriggerDynamicSimulation|canUnloadInCombat|canVehicleCargo|captive|captiveNum|cbChecked|cbSetChecked|ceil|channelEnabled|cheatsEnabled|checkAIFeature|checkVisibility|civilian|className|clear3DENAttribute|clear3DENInventory|clearAllItemsFromBackpack|clearBackpackCargo|clearBackpackCargoGlobal|clearForcesRTD|clearGroupIcons|clearItemCargo|clearItemCargoGlobal|clearItemPool|clearMagazineCargo|clearMagazineCargoGlobal|clearMagazinePool|clearOverlay|clearRadio|clearVehicleInit|clearWeaponCargo|clearWeaponCargoGlobal|clearWeaponPool|clientOwner|closeDialog|closeDisplay|closeOverlay|collapseObjectTree|collect3DENHistory|collectiveRTD|combatMode|commandArtilleryFire|commandChat|commander|commandFire|commandFollow|commandFSM|commandGetOut|commandingMenu|commandMove|commandRadio|commandStop|commandSuppressiveFire|commandTarget|commandWatch|comment|commitOverlay|compile|compileFinal|completedFSM|composeText|configClasses|configFile|configHierarchy|configName|configNull|configProperties|configSourceAddonList|configSourceMod|configSourceModList|confirmSensorTarget|connectTerminalToUAV|controlNull|controlsGroupCtrl|copyFromClipboard|copyToClipboard|copyWaypoints|cos|count|countEnemy|countFriendly|countSide|countType|countUnknown|create3DENComposition|create3DENEntity|createAgent|createCenter|createDialog|createDiaryLink|createDiaryRecord|createDiarySubject|createDisplay|createGearDialog|createGroup|createGuardedPoint|createLocation|createMarker|createMarkerLocal|createMenu|createMine|createMissionDisplay|createMPCampaignDisplay|createSimpleObject|createSimpleTask|createSite|createSoundSource|createTask|createTeam|createTrigger|createUnit|createVehicle|createVehicleCrew|createVehicleLocal|crew|ctAddHeader|ctAddRow|ctClear|ctCurSel|ctData|ctFindHeaderRows|ctFindRowHeader|ctHeaderControls|ctHeaderCount|ctRemoveHeaders|ctRemoveRows|ctrlActivate|ctrlAddEventHandler|ctrlAngle|ctrlAutoScrollDelay|ctrlAutoScrollRewind|ctrlAutoScrollSpeed|ctrlChecked|ctrlClassName|ctrlCommit|ctrlCommitted|ctrlCreate|ctrlDelete|ctrlEnable|ctrlEnabled|ctrlFade|ctrlHTMLLoaded|ctrlIDC|ctrlIDD|ctrlMapAnimAdd|ctrlMapAnimClear|ctrlMapAnimCommit|ctrlMapAnimDone|ctrlMapCursor|ctrlMapMouseOver|ctrlMapScale|ctrlMapScreenToWorld|ctrlMapWorldToScreen|ctrlModel|ctrlModelDirAndUp|ctrlModelScale|ctrlParent|ctrlParentControlsGroup|ctrlPosition|ctrlRemoveAllEventHandlers|ctrlRemoveEventHandler|ctrlScale|ctrlSetActiveColor|ctrlSetAngle|ctrlSetAutoScrollDelay|ctrlSetAutoScrollRewind|ctrlSetAutoScrollSpeed|ctrlSetBackgroundColor|ctrlSetChecked|ctrlSetDisabledColor|ctrlSetEventHandler|ctrlSetFade|ctrlSetFocus|ctrlSetFont|ctrlSetFontH1|ctrlSetFontH1B|ctrlSetFontH2|ctrlSetFontH2B|ctrlSetFontH3|ctrlSetFontH3B|ctrlSetFontH4|ctrlSetFontH4B|ctrlSetFontH5|ctrlSetFontH5B|ctrlSetFontH6|ctrlSetFontH6B|ctrlSetFontHeight|ctrlSetFontHeightH1|ctrlSetFontHeightH2|ctrlSetFontHeightH3|ctrlSetFontHeightH4|ctrlSetFontHeightH5|ctrlSetFontHeightH6|ctrlSetFontHeightSecondary|ctrlSetFontP|ctrlSetFontPB|ctrlSetFontSecondary|ctrlSetForegroundColor|ctrlSetModel|ctrlSetModelDirAndUp|ctrlSetModelScale|ctrlSetPixelPrecision|ctrlSetPosition|ctrlSetScale|ctrlSetStructuredText|ctrlSetText|ctrlSetTextColor|ctrlSetTextColorSecondary|ctrlSetTextSecondary|ctrlSetTooltip|ctrlSetTooltipColorBox|ctrlSetTooltipColorShade|ctrlSetTooltipColorText|ctrlShow|ctrlShown|ctrlText|ctrlTextHeight|ctrlTextSecondary|ctrlTextWidth|ctrlType|ctrlVisible|ctRowControls|ctRowCount|ctSetCurSel|ctSetData|ctSetHeaderTemplate|ctSetRowTemplate|ctSetValue|ctValue|curatorAddons|curatorCamera|curatorCameraArea|curatorCameraAreaCeiling|curatorCoef|curatorEditableObjects|curatorEditingArea|curatorEditingAreaType|curatorMouseOver|curatorPoints|curatorRegisteredObjects|curatorSelected|curatorWaypointCost|current3DENOperation|currentChannel|currentCommand|currentMagazine|currentMagazineDetail|currentMagazineDetailTurret|currentMagazineTurret|currentMuzzle|currentNamespace|currentTask|currentTasks|currentThrowable|currentVisionMode|currentWaypoint|currentWeapon|currentWeaponMode|currentWeaponTurret|currentZeroing|cursorObject|cursorTarget|customChat|customRadio|cutFadeOut|cutObj|cutRsc|cutText|damage|date|dateToNumber|daytime|deActivateKey|debriefingText|debugFSM|debugLog|deg|delete3DENEntities|deleteAt|deleteCenter|deleteCollection|deleteEditorObject|deleteGroup|deleteGroupWhenEmpty|deleteIdentity|deleteLocation|deleteMarker|deleteMarkerLocal|deleteRange|deleteResources|deleteSite|deleteStatus|deleteTeam|deleteVehicle|deleteVehicleCrew|deleteWaypoint|detach|detectedMines|diag_activeMissionFSMs|diag_activeScripts|diag_activeSQFScripts|diag_activeSQSScripts|diag_captureFrame|diag_captureFrameToFile|diag_captureSlowFrame|diag_codePerformance|diag_drawMode|diag_dynamicSimulationEnd|diag_enable|diag_enabled|diag_fps|diag_fpsMin|diag_frameNo|diag_lightNewLoad|diag_list|diag_log|diag_logSlowFrame|diag_mergeConfigFile|diag_recordTurretLimits|diag_setLightNew|diag_tickTime|diag_toggle|dialog|diarySubjectExists|didJIP|didJIPOwner|difficulty|difficultyEnabled|difficultyEnabledRTD|difficultyOption|direction|directSay|disableAI|disableCollisionWith|disableConversation|disableDebriefingStats|disableMapIndicators|disableNVGEquipment|disableRemoteSensors|disableSerialization|disableTIEquipment|disableUAVConnectability|disableUserInput|displayAddEventHandler|displayCtrl|displayNull|displayParent|displayRemoveAllEventHandlers|displayRemoveEventHandler|displaySetEventHandler|dissolveTeam|distance|distance2D|distanceSqr|distributionRegion|do3DENAction|doArtilleryFire|doFire|doFollow|doFSM|doGetOut|doMove|doorPhase|doStop|doSuppressiveFire|doTarget|doWatch|drawArrow|drawEllipse|drawIcon|drawIcon3D|drawLine|drawLine3D|drawLink|drawLocation|drawPolygon|drawRectangle|drawTriangle|driver|drop|dynamicSimulationDistance|dynamicSimulationDistanceCoef|dynamicSimulationEnabled|dynamicSimulationSystemEnabled|east|edit3DENMissionAttributes|editObject|editorSetEventHandler|effectiveCommander|emptyPositions|enableAI|enableAIFeature|enableAimPrecision|enableAttack|enableAudioFeature|enableAutoStartUpRTD|enableAutoTrimRTD|enableCamShake|enableCaustics|enableChannel|enableCollisionWith|enableCopilot|enableDebriefingStats|enableDiagLegend|enableDynamicSimulation|enableDynamicSimulationSystem|enableEndDialog|enableEngineArtillery|enableEnvironment|enableFatigue|enableGunLights|enableInfoPanelComponent|enableIRLasers|enableMimics|enablePersonTurret|enableRadio|enableReload|enableRopeAttach|enableSatNormalOnDetail|enableSaving|enableSentences|enableSimulation|enableSimulationGlobal|enableStamina|enableStressDamage|enableTeamSwitch|enableTraffic|enableUAVConnectability|enableUAVWaypoints|enableVehicleCargo|enableVehicleSensor|enableWeaponDisassembly|endl|endLoadingScreen|endMission|engineOn|enginesIsOnRTD|enginesPowerRTD|enginesRpmRTD|enginesTorqueRTD|entities|environmentEnabled|estimatedEndServerTime|estimatedTimeLeft|evalObjectArgument|everyBackpack|everyContainer|exec|execEditorScript|exp|expectedDestination|exportJIPMessages|eyeDirection|eyePos|face|faction|fadeMusic|fadeRadio|fadeSound|fadeSpeech|failMission|fillWeaponsFromPool|find|findCover|findDisplay|findEditorObject|findEmptyPosition|findEmptyPositionReady|findIf|findNearestEnemy|finishMissionInit|finite|fire|fireAtTarget|firstBackpack|flag|flagAnimationPhase|flagOwner|flagSide|flagTexture|fleeing|floor|flyInHeight|flyInHeightASL|fog|fogForecast|fogParams|forceAddUniform|forceAtPositionRTD|forcedMap|forceEnd|forceFlagTexture|forceFollowRoad|forceGeneratorRTD|forceMap|forceRespawn|forceSpeed|forceWalk|forceWeaponFire|forceWeatherChange|forgetTarget|format|formation|formationDirection|formationLeader|formationMembers|formationPosition|formationTask|formatText|formLeader|freeLook|fromEditor|fuel|fullCrew|gearIDCAmmoCount|gearSlotAmmoCount|gearSlotData|get3DENActionState|get3DENAttribute|get3DENCamera|get3DENConnections|get3DENEntity|get3DENEntityID|get3DENGrid|get3DENIconsVisible|get3DENLayerEntities|get3DENLinesVisible|get3DENMissionAttribute|get3DENMouseOver|get3DENSelected|getAimingCoef|getAllEnvSoundControllers|getAllHitPointsDamage|getAllOwnedMines|getAllSoundControllers|getAmmoCargo|getAnimAimPrecision|getAnimSpeedCoef|getArray|getArtilleryAmmo|getArtilleryComputerSettings|getArtilleryETA|getAssignedCuratorLogic|getAssignedCuratorUnit|getBackpackCargo|getBleedingRemaining|getBurningValue|getCameraViewDirection|getCargoIndex|getCenterOfMass|getClientState|getClientStateNumber|getCompatiblePylonMagazines|getConnectedUAV|getContainerMaxLoad|getCursorObjectParams|getCustomAimCoef|getDammage|getDescription|getDir|getDirVisual|getDLCAssetsUsage|getDLCAssetsUsageByName|getDLCs|getDLCUsageTime|getEditorCamera|getEditorMode|getEditorObjectScope|getElevationOffset|getEngineTargetRpmRTD|getEnvSoundController|getFatigue|getFieldManualStartPage|getForcedFlagTexture|getFriend|getFSMVariable|getFuelCargo|getGroupIcon|getGroupIconParams|getGroupIcons|getHideFrom|getHit|getHitIndex|getHitPointDamage|getItemCargo|getMagazineCargo|getMarkerColor|getMarkerPos|getMarkerSize|getMarkerType|getMass|getMissionConfig|getMissionConfigValue|getMissionDLCs|getMissionLayerEntities|getMissionLayers|getModelInfo|getMousePosition|getMusicPlayedTime|getNumber|getObjectArgument|getObjectChildren|getObjectDLC|getObjectMaterials|getObjectProxy|getObjectTextures|getObjectType|getObjectViewDistance|getOxygenRemaining|getPersonUsedDLCs|getPilotCameraDirection|getPilotCameraPosition|getPilotCameraRotation|getPilotCameraTarget|getPlateNumber|getPlayerChannel|getPlayerScores|getPlayerUID|getPlayerUIDOld|getPos|getPosASL|getPosASLVisual|getPosASLW|getPosATL|getPosATLVisual|getPosVisual|getPosWorld|getPylonMagazines|getRelDir|getRelPos|getRemoteSensorsDisabled|getRepairCargo|getResolution|getRotorBrakeRTD|getShadowDistance|getShotParents|getSlingLoad|getSoundController|getSoundControllerResult|getSpeed|getStamina|getStatValue|getSuppression|getTerrainGrid|getTerrainHeightASL|getText|getTotalDLCUsageTime|getTrimOffsetRTD|getUnitLoadout|getUnitTrait|getUserMFDText|getUserMFDValue|getVariable|getVehicleCargo|getWeaponCargo|getWeaponSway|getWingsOrientationRTD|getWingsPositionRTD|getWPPos|glanceAt|globalChat|globalRadio|goggles|group|groupChat|groupFromNetId|groupIconSelectable|groupIconsVisible|groupId|groupOwner|groupRadio|groupSelectedUnits|groupSelectUnit|grpNull|gunner|gusts|halt|handgunItems|handgunMagazine|handgunWeapon|handsHit|hasInterface|hasPilotCamera|hasWeapon|hcAllGroups|hcGroupParams|hcLeader|hcRemoveAllGroups|hcRemoveGroup|hcSelected|hcSelectGroup|hcSetGroup|hcShowBar|hcShownBar|headgear|hideBody|hideObject|hideObjectGlobal|hideSelection|hint|hintC|hintCadet|hintSilent|hmd|hostMission|htmlLoad|HUDMovementLevels|humidity|image|importAllGroups|importance|in|inArea|inAreaArray|incapacitatedState|independent|inflame|inflamed|infoPanel|infoPanelComponentEnabled|infoPanelComponents|infoPanels|inGameUISetEventHandler|inheritsFrom|initAmbientLife|inPolygon|inputAction|inRangeOfArtillery|insertEditorObject|intersect|is3DEN|is3DENMultiplayer|isAbleToBreathe|isAgent|isAimPrecisionEnabled|isArray|isAutoHoverOn|isAutonomous|isAutoStartUpEnabledRTD|isAutotest|isAutoTrimOnRTD|isBleeding|isBurning|isClass|isCollisionLightOn|isCopilotEnabled|isDamageAllowed|isDedicated|isDLCAvailable|isEngineOn|isEqualTo|isEqualType|isEqualTypeAll|isEqualTypeAny|isEqualTypeArray|isEqualTypeParams|isFilePatchingEnabled|isFlashlightOn|isFlatEmpty|isForcedWalk|isFormationLeader|isGroupDeletedWhenEmpty|isHidden|isInRemainsCollector|isInstructorFigureEnabled|isIRLaserOn|isKeyActive|isKindOf|isLaserOn|isLightOn|isLocalized|isManualFire|isMarkedForCollection|isMultiplayer|isMultiplayerSolo|isNil|isNull|isNumber|isObjectHidden|isObjectRTD|isOnRoad|isPipEnabled|isPlayer|isRealTime|isRemoteExecuted|isRemoteExecutedJIP|isServer|isShowing3DIcons|isSimpleObject|isSprintAllowed|isStaminaEnabled|isSteamMission|isStreamFriendlyUIEnabled|isStressDamageEnabled|isText|isTouchingGround|isTurnedOut|isTutHintsEnabled|isUAVConnectable|isUAVConnected|isUIContext|isUniformAllowed|isVehicleCargo|isVehicleRadarOn|isVehicleSensorEnabled|isWalking|isWeaponDeployed|isWeaponRested|itemCargo|items|itemsWithMagazines|join|joinAs|joinAsSilent|joinSilent|joinString|kbAddDatabase|kbAddDatabaseTargets|kbAddTopic|kbHasTopic|kbReact|kbRemoveTopic|kbTell|kbWasSaid|keyImage|keyName|knowsAbout|land|landAt|landResult|language|laserTarget|lbAdd|lbClear|lbColor|lbColorRight|lbCurSel|lbData|lbDelete|lbIsSelected|lbPicture|lbPictureRight|lbSelection|lbSetColor|lbSetColorRight|lbSetCurSel|lbSetData|lbSetPicture|lbSetPictureColor|lbSetPictureColorDisabled|lbSetPictureColorSelected|lbSetPictureRight|lbSetPictureRightColor|lbSetPictureRightColorDisabled|lbSetPictureRightColorSelected|lbSetSelectColor|lbSetSelectColorRight|lbSetSelected|lbSetText|lbSetTextRight|lbSetTooltip|lbSetValue|lbSize|lbSort|lbSortByValue|lbText|lbTextRight|lbValue|leader|leaderboardDeInit|leaderboardGetRows|leaderboardInit|leaderboardRequestRowsFriends|leaderboardRequestRowsGlobal|leaderboardRequestRowsGlobalAroundUser|leaderboardsRequestUploadScore|leaderboardsRequestUploadScoreKeepBest|leaderboardState|leaveVehicle|libraryCredits|libraryDisclaimers|lifeState|lightAttachObject|lightDetachObject|lightIsOn|lightnings|limitSpeed|linearConversion|lineBreak|lineIntersects|lineIntersectsObjs|lineIntersectsSurfaces|lineIntersectsWith|linkItem|list|listObjects|listRemoteTargets|listVehicleSensors|ln|lnbAddArray|lnbAddColumn|lnbAddRow|lnbClear|lnbColor|lnbColorRight|lnbCurSelRow|lnbData|lnbDeleteColumn|lnbDeleteRow|lnbGetColumnsPosition|lnbPicture|lnbPictureRight|lnbSetColor|lnbSetColorRight|lnbSetColumnsPos|lnbSetCurSelRow|lnbSetData|lnbSetPicture|lnbSetPictureColor|lnbSetPictureColorRight|lnbSetPictureColorSelected|lnbSetPictureColorSelectedRight|lnbSetPictureRight|lnbSetText|lnbSetTextRight|lnbSetValue|lnbSize|lnbSort|lnbSortByValue|lnbText|lnbTextRight|lnbValue|load|loadAbs|loadBackpack|loadFile|loadGame|loadIdentity|loadMagazine|loadOverlay|loadStatus|loadUniform|loadVest|local|localize|locationNull|locationPosition|lock|lockCameraTo|lockCargo|lockDriver|locked|lockedCargo|lockedDriver|lockedTurret|lockIdentity|lockTurret|lockWP|log|logEntities|logNetwork|logNetworkTerminate|lookAt|lookAtPos|magazineCargo|magazines|magazinesAllTurrets|magazinesAmmo|magazinesAmmoCargo|magazinesAmmoFull|magazinesDetail|magazinesDetailBackpack|magazinesDetailUniform|magazinesDetailVest|magazinesTurret|magazineTurretAmmo|mapAnimAdd|mapAnimClear|mapAnimCommit|mapAnimDone|mapCenterOnCamera|mapGridPosition|markAsFinishedOnSteam|markerAlpha|markerBrush|markerColor|markerDir|markerPos|markerShape|markerSize|markerText|markerType|max|members|menuAction|menuAdd|menuChecked|menuClear|menuCollapse|menuData|menuDelete|menuEnable|menuEnabled|menuExpand|menuHover|menuPicture|menuSetAction|menuSetCheck|menuSetData|menuSetPicture|menuSetValue|menuShortcut|menuShortcutText|menuSize|menuSort|menuText|menuURL|menuValue|min|mineActive|mineDetectedBy|missionConfigFile|missionDifficulty|missionName|missionNamespace|missionStart|missionVersion|modelToWorld|modelToWorldVisual|modelToWorldVisualWorld|modelToWorldWorld|modParams|moonIntensity|moonPhase|morale|move|move3DENCamera|moveInAny|moveInCargo|moveInCommander|moveInDriver|moveInGunner|moveInTurret|moveObjectToEnd|moveOut|moveTime|moveTo|moveToCompleted|moveToFailed|musicVolume|name|nameSound|nearEntities|nearestBuilding|nearestLocation|nearestLocations|nearestLocationWithDubbing|nearestObject|nearestObjects|nearestTerrainObjects|nearObjects|nearObjectsReady|nearRoads|nearSupplies|nearTargets|needReload|netId|netObjNull|newOverlay|nextMenuItemIndex|nextWeatherChange|nMenuItems|numberOfEnginesRTD|numberToDate|objectCurators|objectFromNetId|objectParent|objNull|objStatus|onBriefingGear|onBriefingGroup|onBriefingNotes|onBriefingPlan|onBriefingTeamSwitch|onCommandModeChanged|onDoubleClick|onEachFrame|onGroupIconClick|onGroupIconOverEnter|onGroupIconOverLeave|onHCGroupSelectionChanged|onMapSingleClick|onPlayerConnected|onPlayerDisconnected|onPreloadFinished|onPreloadStarted|onShowNewObject|onTeamSwitch|openCuratorInterface|openDLCPage|openDSInterface|openMap|openSteamApp|openYoutubeVideo|opfor|orderGetIn|overcast|overcastForecast|owner|param|params|parseNumber|parseSimpleArray|parseText|parsingNamespace|particlesQuality|pi|pickWeaponPool|pitch|pixelGrid|pixelGridBase|pixelGridNoUIScale|pixelH|pixelW|playableSlotsNumber|playableUnits|playAction|playActionNow|player|playerRespawnTime|playerSide|playersNumber|playGesture|playMission|playMove|playMoveNow|playMusic|playScriptedMission|playSound|playSound3D|position|positionCameraToWorld|posScreenToWorld|posWorldToScreen|ppEffectAdjust|ppEffectCommit|ppEffectCommitted|ppEffectCreate|ppEffectDestroy|ppEffectEnable|ppEffectEnabled|ppEffectForceInNVG|precision|preloadCamera|preloadObject|preloadSound|preloadTitleObj|preloadTitleRsc|primaryWeapon|primaryWeaponItems|primaryWeaponMagazine|priority|processDiaryLink|processInitCommands|productVersion|profileName|profileNamespace|profileNameSteam|progressLoadingScreen|progressPosition|progressSetPosition|publicVariable|publicVariableClient|publicVariableServer|pushBack|pushBackUnique|putWeaponPool|queryItemsPool|queryMagazinePool|queryWeaponPool|rad|radioChannelAdd|radioChannelCreate|radioChannelRemove|radioChannelSetCallSign|radioChannelSetLabel|radioVolume|rain|rainbow|random|rank|rankId|rating|rectangular|registeredTasks|registerTask|reload|reloadEnabled|remoteControl|remoteExec|remoteExecCall|remoteExecutedOwner|remove3DENConnection|remove3DENEventHandler|remove3DENLayer|removeAction|removeAll3DENEventHandlers|removeAllActions|removeAllAssignedItems|removeAllContainers|removeAllCuratorAddons|removeAllCuratorCameraAreas|removeAllCuratorEditingAreas|removeAllEventHandlers|removeAllHandgunItems|removeAllItems|removeAllItemsWithMagazines|removeAllMissionEventHandlers|removeAllMPEventHandlers|removeAllMusicEventHandlers|removeAllOwnedMines|removeAllPrimaryWeaponItems|removeAllWeapons|removeBackpack|removeBackpackGlobal|removeCuratorAddons|removeCuratorCameraArea|removeCuratorEditableObjects|removeCuratorEditingArea|removeDrawIcon|removeDrawLinks|removeEventHandler|removeFromRemainsCollector|removeGoggles|removeGroupIcon|removeHandgunItem|removeHeadgear|removeItem|removeItemFromBackpack|removeItemFromUniform|removeItemFromVest|removeItems|removeMagazine|removeMagazineGlobal|removeMagazines|removeMagazinesTurret|removeMagazineTurret|removeMenuItem|removeMissionEventHandler|removeMPEventHandler|removeMusicEventHandler|removeOwnedMine|removePrimaryWeaponItem|removeSecondaryWeaponItem|removeSimpleTask|removeSwitchableUnit|removeTeamMember|removeUniform|removeVest|removeWeapon|removeWeaponAttachmentCargo|removeWeaponCargo|removeWeaponGlobal|removeWeaponTurret|reportRemoteTarget|requiredVersion|resetCamShake|resetSubgroupDirection|resistance|resize|resources|respawnVehicle|restartEditorCamera|reveal|revealMine|reverse|reversedMouseY|roadAt|roadsConnectedTo|roleDescription|ropeAttachedObjects|ropeAttachedTo|ropeAttachEnabled|ropeAttachTo|ropeCreate|ropeCut|ropeDestroy|ropeDetach|ropeEndPosition|ropeLength|ropes|ropeUnwind|ropeUnwound|rotorsForcesRTD|rotorsRpmRTD|round|runInitScript|safeZoneH|safeZoneW|safeZoneWAbs|safeZoneX|safeZoneXAbs|safeZoneY|save3DENInventory|saveGame|saveIdentity|saveJoysticks|saveOverlay|saveProfileNamespace|saveStatus|saveVar|savingEnabled|say|say2D|say3D|score|scoreSide|screenshot|screenToWorld|scriptDone|scriptName|scriptNull|scudState|secondaryWeapon|secondaryWeaponItems|secondaryWeaponMagazine|select|selectBestPlaces|selectDiarySubject|selectedEditorObjects|selectEditorObject|selectionNames|selectionPosition|selectLeader|selectMax|selectMin|selectNoPlayer|selectPlayer|selectRandom|selectRandomWeighted|selectWeapon|selectWeaponTurret|sendAUMessage|sendSimpleCommand|sendTask|sendTaskResult|sendUDPMessage|serverCommand|serverCommandAvailable|serverCommandExecutable|serverName|serverTime|set|set3DENAttribute|set3DENAttributes|set3DENGrid|set3DENIconsVisible|set3DENLayer|set3DENLinesVisible|set3DENLogicType|set3DENMissionAttribute|set3DENMissionAttributes|set3DENModelsVisible|set3DENObjectType|set3DENSelected|setAccTime|setActualCollectiveRTD|setAirplaneThrottle|setAirportSide|setAmmo|setAmmoCargo|setAmmoOnPylon|setAnimSpeedCoef|setAperture|setApertureNew|setArmoryPoints|setAttributes|setAutonomous|setBehaviour|setBleedingRemaining|setBrakesRTD|setCameraInterest|setCamShakeDefParams|setCamShakeParams|setCamUseTI|setCaptive|setCenterOfMass|setCollisionLight|setCombatMode|setCompassOscillation|setConvoySeparation|setCuratorCameraAreaCeiling|setCuratorCoef|setCuratorEditingAreaType|setCuratorWaypointCost|setCurrentChannel|setCurrentTask|setCurrentWaypoint|setCustomAimCoef|setCustomWeightRTD|setDamage|setDammage|setDate|setDebriefingText|setDefaultCamera|setDestination|setDetailMapBlendPars|setDir|setDirection|setDrawIcon|setDriveOnPath|setDropInterval|setDynamicSimulationDistance|setDynamicSimulationDistanceCoef|setEditorMode|setEditorObjectScope|setEffectCondition|setEngineRpmRTD|setFace|setFaceAnimation|setFatigue|setFeatureType|setFlagAnimationPhase|setFlagOwner|setFlagSide|setFlagTexture|setFog|setForceGeneratorRTD|setFormation|setFormationTask|setFormDir|setFriend|setFromEditor|setFSMVariable|setFuel|setFuelCargo|setGroupIcon|setGroupIconParams|setGroupIconsSelectable|setGroupIconsVisible|setGroupId|setGroupIdGlobal|setGroupOwner|setGusts|setHideBehind|setHit|setHitIndex|setHitPointDamage|setHorizonParallaxCoef|setHUDMovementLevels|setIdentity|setImportance|setInfoPanel|setLeader|setLightAmbient|setLightAttenuation|setLightBrightness|setLightColor|setLightDayLight|setLightFlareMaxDistance|setLightFlareSize|setLightIntensity|setLightnings|setLightUseFlare|setLocalWindParams|setMagazineTurretAmmo|setMarkerAlpha|setMarkerAlphaLocal|setMarkerBrush|setMarkerBrushLocal|setMarkerColor|setMarkerColorLocal|setMarkerDir|setMarkerDirLocal|setMarkerPos|setMarkerPosLocal|setMarkerShape|setMarkerShapeLocal|setMarkerSize|setMarkerSizeLocal|setMarkerText|setMarkerTextLocal|setMarkerType|setMarkerTypeLocal|setMass|setMimic|setMousePosition|setMusicEffect|setMusicEventHandler|setName|setNameSound|setObjectArguments|setObjectMaterial|setObjectMaterialGlobal|setObjectProxy|setObjectTexture|setObjectTextureGlobal|setObjectViewDistance|setOvercast|setOwner|setOxygenRemaining|setParticleCircle|setParticleClass|setParticleFire|setParticleParams|setParticleRandom|setPilotCameraDirection|setPilotCameraRotation|setPilotCameraTarget|setPilotLight|setPiPEffect|setPitch|setPlateNumber|setPlayable|setPlayerRespawnTime|setPos|setPosASL|setPosASL2|setPosASLW|setPosATL|setPosition|setPosWorld|setPylonLoadOut|setPylonsPriority|setRadioMsg|setRain|setRainbow|setRandomLip|setRank|setRectangular|setRepairCargo|setRotorBrakeRTD|setShadowDistance|setShotParents|setSide|setSimpleTaskAlwaysVisible|setSimpleTaskCustomData|setSimpleTaskDescription|setSimpleTaskDestination|setSimpleTaskTarget|setSimpleTaskType|setSimulWeatherLayers|setSize|setSkill|setSlingLoad|setSoundEffect|setSpeaker|setSpeech|setSpeedMode|setStamina|setStaminaScheme|setStatValue|setSuppression|setSystemOfUnits|setTargetAge|setTaskMarkerOffset|setTaskResult|setTaskState|setTerrainGrid|setText|setTimeMultiplier|setTitleEffect|setToneMapping|setToneMappingParams|setTrafficDensity|setTrafficDistance|setTrafficGap|setTrafficSpeed|setTriggerActivation|setTriggerArea|setTriggerStatements|setTriggerText|setTriggerTimeout|setTriggerType|setType|setUnconscious|setUnitAbility|setUnitLoadout|setUnitPos|setUnitPosWeak|setUnitRank|setUnitRecoilCoefficient|setUnitTrait|setUnloadInCombat|setUserActionText|setUserMFDText|setUserMFDValue|setVariable|setVectorDir|setVectorDirAndUp|setVectorUp|setVehicleAmmo|setVehicleAmmoDef|setVehicleArmor|setVehicleCargo|setVehicleId|setVehicleInit|setVehicleLock|setVehiclePosition|setVehicleRadar|setVehicleReceiveRemoteTargets|setVehicleReportOwnPosition|setVehicleReportRemoteTargets|setVehicleTIPars|setVehicleVarName|setVelocity|setVelocityModelSpace|setVelocityTransformation|setViewDistance|setVisibleIfTreeCollapsed|setWantedRpmRTD|setWaves|setWaypointBehaviour|setWaypointCombatMode|setWaypointCompletionRadius|setWaypointDescription|setWaypointForceBehaviour|setWaypointFormation|setWaypointHousePosition|setWaypointLoiterRadius|setWaypointLoiterType|setWaypointName|setWaypointPosition|setWaypointScript|setWaypointSpeed|setWaypointStatements|setWaypointTimeout|setWaypointType|setWaypointVisible|setWeaponReloadingTime|setWind|setWindDir|setWindForce|setWindStr|setWingForceScaleRTD|setWPPos|show3DIcons|showChat|showCinemaBorder|showCommandingMenu|showCompass|showCuratorCompass|showGPS|showHUD|showLegend|showMap|shownArtilleryComputer|shownChat|shownCompass|shownCuratorCompass|showNewEditorObject|shownGPS|shownHUD|shownMap|shownPad|shownRadio|shownScoretable|shownUAVFeed|shownWarrant|shownWatch|showPad|showRadio|showScoretable|showSubtitles|showUAVFeed|showWarrant|showWatch|showWaypoint|showWaypoints|side|sideAmbientLife|sideChat|sideEmpty|sideEnemy|sideFriendly|sideLogic|sideRadio|sideUnknown|simpleTasks|simulationEnabled|simulCloudDensity|simulCloudOcclusion|simulInClouds|simulWeatherSync|sin|size|sizeOf|skill|skillFinal|skipTime|sleep|sliderPosition|sliderRange|sliderSetPosition|sliderSetRange|sliderSetSpeed|sliderSpeed|slingLoadAssistantShown|soldierMagazines|someAmmo|sort|soundVolume|speaker|speed|speedMode|splitString|sqrt|squadParams|stance|startLoadingScreen|stop|stopEngineRTD|stopped|str|sunOrMoon|supportInfo|suppressFor|surfaceIsWater|surfaceNormal|surfaceType|swimInDepth|switchableUnits|switchAction|switchCamera|switchGesture|switchLight|switchMove|synchronizedObjects|synchronizedTriggers|synchronizedWaypoints|synchronizeObjectsAdd|synchronizeObjectsRemove|synchronizeTrigger|synchronizeWaypoint|systemChat|systemOfUnits|tan|targetKnowledge|targets|targetsAggregate|targetsQuery|taskAlwaysVisible|taskChildren|taskCompleted|taskCustomData|taskDescription|taskDestination|taskHint|taskMarkerOffset|taskNull|taskParent|taskResult|taskState|taskType|teamMember|teamMemberNull|teamName|teams|teamSwitch|teamSwitchEnabled|teamType|terminate|terrainIntersect|terrainIntersectASL|terrainIntersectAtASL|text|textLog|textLogFormat|tg|time|timeMultiplier|titleCut|titleFadeOut|titleObj|titleRsc|titleText|toArray|toFixed|toLower|toString|toUpper|triggerActivated|triggerActivation|triggerArea|triggerAttachedVehicle|triggerAttachObject|triggerAttachVehicle|triggerDynamicSimulation|triggerStatements|triggerText|triggerTimeout|triggerTimeoutCurrent|triggerType|turretLocal|turretOwner|turretUnit|tvAdd|tvClear|tvCollapse|tvCollapseAll|tvCount|tvCurSel|tvData|tvDelete|tvExpand|tvExpandAll|tvPicture|tvPictureRight|tvSetColor|tvSetCurSel|tvSetData|tvSetPicture|tvSetPictureColor|tvSetPictureColorDisabled|tvSetPictureColorSelected|tvSetPictureRight|tvSetPictureRightColor|tvSetPictureRightColorDisabled|tvSetPictureRightColorSelected|tvSetSelectColor|tvSetText|tvSetTooltip|tvSetValue|tvSort|tvSortByValue|tvText|tvTooltip|tvValue|type|typeName|typeOf|UAVControl|uiNamespace|uiSleep|unassignCurator|unassignItem|unassignTeam|unassignVehicle|underwater|uniform|uniformContainer|uniformItems|uniformMagazines|unitAddons|unitAimPosition|unitAimPositionVisual|unitBackpack|unitIsUAV|unitPos|unitReady|unitRecoilCoefficient|units|unitsBelowHeight|unlinkItem|unlockAchievement|unregisterTask|updateDrawIcon|updateMenuItem|updateObjectTree|useAIOperMapObstructionTest|useAISteeringComponent|useAudioTimeForMoves|userInputDisabled|vectorAdd|vectorCos|vectorCrossProduct|vectorDiff|vectorDir|vectorDirVisual|vectorDistance|vectorDistanceSqr|vectorDotProduct|vectorFromTo|vectorMagnitude|vectorMagnitudeSqr|vectorModelToWorld|vectorModelToWorldVisual|vectorMultiply|vectorNormalized|vectorUp|vectorUpVisual|vectorWorldToModel|vectorWorldToModelVisual|vehicle|vehicleCargoEnabled|vehicleChat|vehicleRadio|vehicleReceiveRemoteTargets|vehicleReportOwnPosition|vehicleReportRemoteTargets|vehicles|vehicleVarName|velocity|velocityModelSpace|verifySignature|vest|vestContainer|vestItems|vestMagazines|viewDistance|visibleCompass|visibleGPS|visibleMap|visiblePosition|visiblePositionASL|visibleScoretable|visibleWatch|waitUntil|waves|waypointAttachedObject|waypointAttachedVehicle|waypointAttachObject|waypointAttachVehicle|waypointBehaviour|waypointCombatMode|waypointCompletionRadius|waypointDescription|waypointForceBehaviour|waypointFormation|waypointHousePosition|waypointLoiterRadius|waypointLoiterType|waypointName|waypointPosition|waypoints|waypointScript|waypointsEnabledUAV|waypointShow|waypointSpeed|waypointStatements|waypointTimeout|waypointTimeoutCurrent|waypointType|waypointVisible|weaponAccessories|weaponAccessoriesCargo|weaponCargo|weaponDirection|weaponInertia|weaponLowered|weapons|weaponsItems|weaponsItemsCargo|weaponState|weaponsTurret|weightRTD|west|WFSideText|wind|windDir|windRTD|windStr|wingsForcesRTD|worldName|worldSize|worldToModel|worldToModelVisual|worldToScreen)\b/i,number:/(?:\$|\b0x)[\da-f]+\b|(?:\B\.\d+|\b\d+(?:\.\d+)?)(?:e[+-]?\d+)?\b/i,operator:/##|>>|&&|\|\||[!=<>]=?|[-+*/%#^]|\b(?:and|mod|not|or)\b/i,"magic-variable":{pattern:/\b(?:this|thisList|thisTrigger|_exception|_fnc_scriptName|_fnc_scriptNameParent|_forEachIndex|_this|_thisEventHandler|_thisFSM|_thisScript|_x)\b/i,alias:"keyword"},constant:/\bDIK(?:_[a-z\d]+)+\b/i}),e.languages.insertBefore("sqf","string",{macro:{pattern:/(^[ \t]*)#[a-z](?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{directive:{pattern:/#[a-z]+\b/i,alias:"keyword"},comment:e.languages.sqf.comment}}}),delete e.languages.sqf["class-name"]}kg.displayName="squirrel";kg.aliases=[];function kg(e){e.register(rt),e.languages.squirrel=e.languages.extend("clike",{comment:[e.languages.clike.comment[0],{pattern:/(^|[^\\:])(?:\/\/|#).*/,lookbehind:!0,greedy:!0}],string:{pattern:/(^|[^\\"'@])(?:@"(?:[^"]|"")*"(?!")|"(?:[^\\\r\n"]|\\.)*")/,lookbehind:!0,greedy:!0},"class-name":{pattern:/(\b(?:class|enum|extends|instanceof)\s+)\w+(?:\.\w+)*/,lookbehind:!0,inside:{punctuation:/\./}},keyword:/\b(?:__FILE__|__LINE__|base|break|case|catch|class|clone|const|constructor|continue|default|delete|else|enum|extends|for|foreach|function|if|in|instanceof|local|null|resume|return|static|switch|this|throw|try|typeof|while|yield)\b/,number:/\b(?:0x[0-9a-fA-F]+|\d+(?:\.(?:\d+|[eE][+-]?\d+))?)\b/,operator:/\+\+|--|<=>|<[-<]|>>>?|&&?|\|\|?|[-+*/%!=<>]=?|[~^]|::?/,punctuation:/[(){}\[\],;.]/}),e.languages.insertBefore("squirrel","string",{char:{pattern:/(^|[^\\"'])'(?:[^\\']|\\(?:[xuU][0-9a-fA-F]{0,8}|[\s\S]))'/,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("squirrel","operator",{"attribute-punctuation":{pattern:/<\/|\/>/,alias:"important"},lambda:{pattern:/@(?=\()/,alias:"operator"}})}_g.displayName="stan";_g.aliases=[];function _g(e){(function(t){var n=/\b(?:algebra_solver|algebra_solver_newton|integrate_1d|integrate_ode|integrate_ode_bdf|integrate_ode_rk45|map_rect|ode_(?:adams|bdf|ckrk|rk45)(?:_tol)?|ode_adjoint_tol_ctl|reduce_sum|reduce_sum_static)\b/;t.languages.stan={comment:/\/\/.*|\/\*[\s\S]*?\*\/|#(?!include).*/,string:{pattern:/"[\x20\x21\x23-\x5B\x5D-\x7E]*"/,greedy:!0},directive:{pattern:/^([ \t]*)#include\b.*/m,lookbehind:!0,alias:"property"},"function-arg":{pattern:RegExp("("+n.source+/\s*\(\s*/.source+")"+/[a-zA-Z]\w*/.source),lookbehind:!0,alias:"function"},constraint:{pattern:/(\b(?:int|matrix|real|row_vector|vector)\s*)<[^<>]*>/,lookbehind:!0,inside:{expression:{pattern:/(=\s*)\S(?:\S|\s+(?!\s))*?(?=\s*(?:>$|,\s*\w+\s*=))/,lookbehind:!0,inside:null},property:/\b[a-z]\w*(?=\s*=)/i,operator:/=/,punctuation:/^<|>$|,/}},keyword:[{pattern:/\bdata(?=\s*\{)|\b(?:functions|generated|model|parameters|quantities|transformed)\b/,alias:"program-block"},/\b(?:array|break|cholesky_factor_corr|cholesky_factor_cov|complex|continue|corr_matrix|cov_matrix|data|else|for|if|in|increment_log_prob|int|matrix|ordered|positive_ordered|print|real|reject|return|row_vector|simplex|target|unit_vector|vector|void|while)\b/,n],function:/\b[a-z]\w*(?=\s*\()/i,number:/(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:E[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,boolean:/\b(?:false|true)\b/,operator:/<-|\.[*/]=?|\|\|?|&&|[!=<>+\-*/]=?|['^%~?:]/,punctuation:/[()\[\]{},;]/},t.languages.stan.constraint.inside.expression.inside=t.languages.stan})(e)}Cg.displayName="stata";Cg.aliases=[];function Cg(e){e.register(ms),e.register(bu),e.register(Gi),e.languages.stata={comment:[{pattern:/(^[ \t]*)\*.*/m,lookbehind:!0,greedy:!0},{pattern:/(^|\s)\/\/.*|\/\*[\s\S]*?\*\//,lookbehind:!0,greedy:!0}],"string-literal":{pattern:/"[^"\r\n]*"|[‘`']".*?"[’`']/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^{}]*\}|[‘`']\w[^’`'\r\n]*[’`']/,inside:{punctuation:/^\$\{|\}$/,expression:{pattern:/[\s\S]+/,inside:null}}},string:/[\s\S]+/}},mata:{pattern:/(^[ \t]*mata[ \t]*:)[\s\S]+?(?=^end\b)/m,lookbehind:!0,greedy:!0,alias:"language-mata",inside:e.languages.mata},java:{pattern:/(^[ \t]*java[ \t]*:)[\s\S]+?(?=^end\b)/m,lookbehind:!0,greedy:!0,alias:"language-java",inside:e.languages.java},python:{pattern:/(^[ \t]*python[ \t]*:)[\s\S]+?(?=^end\b)/m,lookbehind:!0,greedy:!0,alias:"language-python",inside:e.languages.python},command:{pattern:/(^[ \t]*(?:\.[ \t]+)?(?:(?:bayes|bootstrap|by|bysort|capture|collect|fmm|fp|frame|jackknife|mfp|mi|nestreg|noisily|permute|quietly|rolling|simulate|statsby|stepwise|svy|version|xi)\b[^:\r\n]*:[ \t]*|(?:capture|noisily|quietly|version)[ \t]+)?)[a-zA-Z]\w*/m,lookbehind:!0,greedy:!0,alias:"keyword"},variable:/\$\w+|[‘`']\w[^’`'\r\n]*[’`']/,keyword:/\b(?:bayes|bootstrap|by|bysort|capture|clear|collect|fmm|fp|frame|if|in|jackknife|mi[ \t]+estimate|mfp|nestreg|noisily|of|permute|quietly|rolling|simulate|sort|statsby|stepwise|svy|varlist|version|xi)\b/,boolean:/\b(?:off|on)\b/,number:/\b\d+(?:\.\d+)?\b|\B\.\d+/,function:/\b[a-z_]\w*(?=\()/i,operator:/\+\+|--|##?|[<>!=~]=?|[+\-*^&|/]/,punctuation:/[(){}[\],:]/},e.languages.stata["string-literal"].inside.interpolation.inside.expression.inside=e.languages.stata}Ig.displayName="iecst";Ig.aliases=[];function Ig(e){e.languages.iecst={comment:[{pattern:/(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\(\*[\s\S]*?(?:\*\)|$)|\{[\s\S]*?(?:\}|$))/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:[/\b(?:END_)?(?:PROGRAM|CONFIGURATION|INTERFACE|FUNCTION_BLOCK|FUNCTION|ACTION|TRANSITION|TYPE|STRUCT|(?:INITIAL_)?STEP|NAMESPACE|LIBRARY|CHANNEL|FOLDER|RESOURCE|VAR_(?:ACCESS|CONFIG|EXTERNAL|GLOBAL|INPUT|IN_OUT|OUTPUT|TEMP)|VAR|METHOD|PROPERTY)\b/i,/\b(?:AT|BY|(?:END_)?(?:CASE|FOR|IF|REPEAT|WHILE)|CONSTANT|CONTINUE|DO|ELSE|ELSIF|EXIT|EXTENDS|FROM|GET|GOTO|IMPLEMENTS|JMP|NON_RETAIN|OF|PRIVATE|PROTECTED|PUBLIC|RETAIN|RETURN|SET|TASK|THEN|TO|UNTIL|USING|WITH|__CATCH|__ENDTRY|__FINALLY|__TRY)\b/],"class-name":/\b(?:ANY|ARRAY|BOOL|BYTE|U?(?:D|L|S)?INT|(?:D|L)?WORD|DATE(?:_AND_TIME)?|DT|L?REAL|POINTER|STRING|TIME(?:_OF_DAY)?|TOD)\b/,address:{pattern:/%[IQM][XBWDL][\d.]*|%[IQ][\d.]*/,alias:"symbol"},number:/\b(?:16#[\da-f]+|2#[01_]+|0x[\da-f]+)\b|\b(?:D|DT|T|TOD)#[\d_shmd:]*|\b[A-Z]*#[\d.,_]*|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,boolean:/\b(?:FALSE|NULL|TRUE)\b/,operator:/S?R?:?=>?|&&?|\*\*?|<[=>]?|>=?|[-:^/+#]|\b(?:AND|EQ|EXPT|GE|GT|LE|LT|MOD|NE|NOT|OR|XOR)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,punctuation:/[()[\].,;]/}}Rg.displayName="supercollider";Rg.aliases=["sclang"];function Rg(e){e.languages.supercollider={comment:{pattern:/\/\/.*|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/)*\*\//,greedy:!0},string:{pattern:/(^|[^\\])"(?:[^"\\]|\\[\s\S])*"/,lookbehind:!0,greedy:!0},char:{pattern:/\$(?:[^\\\r\n]|\\.)/,greedy:!0},symbol:{pattern:/(^|[^\\])'(?:[^'\\]|\\[\s\S])*'|\\\w+/,lookbehind:!0,greedy:!0},keyword:/\b(?:_|arg|classvar|const|nil|var|while)\b/,boolean:/\b(?:false|true)\b/,label:{pattern:/\b[a-z_]\w*(?=\s*:)/,alias:"property"},number:/\b(?:inf|pi|0x[0-9a-fA-F]+|\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(?:pi)?|\d+r[0-9a-zA-Z]+(?:\.[0-9a-zA-Z]+)?|\d+[sb]{1,4}\d*)\b/,"class-name":/\b[A-Z]\w*\b/,operator:/\.{2,3}|#(?![[{])|&&|[!=]==?|\+>>|\+{1,3}|-[->]|=>|>>|\?\?|@\|?@|\|(?:@|[!=]=)?\||!\?|<[!=>]|\*{1,2}|<{2,3}\*?|[-!%&/<>?@|=`]/,punctuation:/[{}()[\].:,;]|#[[{]/},e.languages.sclang=e.languages.supercollider}Dg.displayName="systemd";Dg.aliases=[];function Dg(e){(function(t){var n={pattern:/^[;#].*/m,greedy:!0},r=/"(?:[^\r\n"\\]|\\(?:[^\r]|\r\n?))*"(?!\S)/.source;t.languages.systemd={comment:n,section:{pattern:/^\[[^\n\r\[\]]*\](?=[ \t]*$)/m,greedy:!0,inside:{punctuation:/^\[|\]$/,"section-name":{pattern:/[\s\S]+/,alias:"selector"}}},key:{pattern:/^[^\s=]+(?=[ \t]*=)/m,greedy:!0,alias:"attr-name"},value:{pattern:RegExp(/(=[ \t]*(?!\s))/.source+"(?:"+r+`|(?=[^"\r
|
|
82
82
|
]))(?:`+(/[^\s\\]/.source+'|[ ]+(?:(?![ "])|'+r+")|"+/\\[\r\n]+(?:[#;].*[\r\n]+)*(?![#;])/.source)+")*"),lookbehind:!0,greedy:!0,alias:"attr-value",inside:{comment:n,quoted:{pattern:RegExp(/(^|\s)/.source+r),lookbehind:!0,greedy:!0},punctuation:/\\$/m,boolean:{pattern:/^(?:false|no|off|on|true|yes)$/,greedy:!0}}},punctuation:/=/}})(e)}Zi.displayName="t4-templating";Zi.aliases=[];function Zi(e){(function(t){function n(s,i,o){return{pattern:RegExp("<#"+s+"[\\s\\S]*?#>"),alias:"block",inside:{delimiter:{pattern:RegExp("^<#"+s+"|#>$"),alias:"important"},content:{pattern:/[\s\S]+/,inside:i,alias:o}}}}function r(s){var i=t.languages[s],o="language-"+s;return{block:{pattern:/<#[\s\S]+?#>/,inside:{directive:n("@",{"attr-value":{pattern:/=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+)/,inside:{punctuation:/^=|^["']|["']$/}},keyword:/\b\w+(?=\s)/,"attr-name":/\b\w+/}),expression:n("=",i,o),"class-feature":n("\\+",i,o),standard:n("",i,o)}}}}t.languages["t4-templating"]=Object.defineProperty({},"createT4",{value:r})})(e)}Og.displayName="t4-cs";Og.aliases=["t4"];function Og(e){e.register(fs),e.register(Zi),e.languages.t4=e.languages["t4-cs"]=e.languages["t4-templating"].createT4("csharp")}Lg.displayName="t4-vb";Lg.aliases=[];function Lg(e){e.register(Zi),e.register(qi),e.languages["t4-vb"]=e.languages["t4-templating"].createT4("vbnet")}jg.displayName="tap";jg.aliases=[];function jg(e){e.register(Hi),e.languages.tap={fail:/not ok[^#{\n\r]*/,pass:/ok[^#{\n\r]*/,pragma:/pragma [+-][a-z]+/,bailout:/bail out!.*/i,version:/TAP version \d+/i,plan:/\b\d+\.\.\d+(?: +#.*)?/,subtest:{pattern:/# Subtest(?:: .*)?/,greedy:!0},punctuation:/[{}]/,directive:/#.*/,yamlish:{pattern:/(^[ \t]*)---[\s\S]*?[\r\n][ \t]*\.\.\.$/m,lookbehind:!0,inside:e.languages.yaml,alias:"language-yaml"}}}Mg.displayName="tcl";Mg.aliases=[];function Mg(e){e.languages.tcl={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:{pattern:/"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*"/,greedy:!0},variable:[{pattern:/(\$)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/,lookbehind:!0},{pattern:/(\$)\{[^}]+\}/,lookbehind:!0},{pattern:/(^[\t ]*set[ \t]+)(?:::)?(?:[a-zA-Z0-9]+::)*\w+/m,lookbehind:!0}],function:{pattern:/(^[\t ]*proc[ \t]+)\S+/m,lookbehind:!0},builtin:[{pattern:/(^[\t ]*)(?:break|class|continue|error|eval|exit|for|foreach|if|proc|return|switch|while)\b/m,lookbehind:!0},/\b(?:else|elseif)\b/],scope:{pattern:/(^[\t ]*)(?:global|upvar|variable)\b/m,lookbehind:!0,alias:"constant"},keyword:{pattern:/(^[\t ]*|\[)(?:Safe_Base|Tcl|after|append|apply|array|auto_(?:execok|import|load|mkindex|qualify|reset)|automkindex_old|bgerror|binary|catch|cd|chan|clock|close|concat|dde|dict|encoding|eof|exec|expr|fblocked|fconfigure|fcopy|file(?:event|name)?|flush|gets|glob|history|http|incr|info|interp|join|lappend|lassign|lindex|linsert|list|llength|load|lrange|lrepeat|lreplace|lreverse|lsearch|lset|lsort|math(?:func|op)|memory|msgcat|namespace|open|package|parray|pid|pkg_mkIndex|platform|puts|pwd|re_syntax|read|refchan|regexp|registry|regsub|rename|scan|seek|set|socket|source|split|string|subst|tcl(?:_endOfWord|_findLibrary|startOf(?:Next|Previous)Word|test|vars|wordBreak(?:After|Before))|tell|time|tm|trace|unknown|unload|unset|update|uplevel|vwait)\b/m,lookbehind:!0},operator:/!=?|\*\*?|==|&&?|\|\|?|<[=<]?|>[=>]?|[-+~\/%?^]|\b(?:eq|in|ne|ni)\b/,punctuation:/[{}()\[\]]/}}Fg.displayName="tt2";Fg.aliases=[];function Fg(e){e.register(rt),e.register(dn),(function(t){t.languages.tt2=t.languages.extend("clike",{comment:/#.*|\[%#[\s\S]*?%\]/,keyword:/\b(?:BLOCK|CALL|CASE|CATCH|CLEAR|DEBUG|DEFAULT|ELSE|ELSIF|END|FILTER|FINAL|FOREACH|GET|IF|IN|INCLUDE|INSERT|LAST|MACRO|META|NEXT|PERL|PROCESS|RAWPERL|RETURN|SET|STOP|SWITCH|TAGS|THROW|TRY|UNLESS|USE|WHILE|WRAPPER)\b/,punctuation:/[[\]{},()]/}),t.languages.insertBefore("tt2","number",{operator:/=[>=]?|!=?|<=?|>=?|&&|\|\|?|\b(?:and|not|or)\b/,variable:{pattern:/\b[a-z]\w*(?:\s*\.\s*(?:\d+|\$?[a-z]\w*))*\b/i}}),t.languages.insertBefore("tt2","keyword",{delimiter:{pattern:/^(?:\[%|%%)-?|-?%\]$/,alias:"punctuation"}}),t.languages.insertBefore("tt2","string",{"single-quoted-string":{pattern:/'[^\\']*(?:\\[\s\S][^\\']*)*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"[^\\"]*(?:\\[\s\S][^\\"]*)*"/,greedy:!0,alias:"string",inside:{variable:{pattern:/\$(?:[a-z]\w*(?:\.(?:\d+|\$?[a-z]\w*))*)/i}}}}),delete t.languages.tt2.string,t.hooks.add("before-tokenize",function(n){var r=/\[%[\s\S]+?%\]/g;t.languages["markup-templating"].buildPlaceholders(n,"tt2",r)}),t.hooks.add("after-tokenize",function(n){t.languages["markup-templating"].tokenizePlaceholders(n,"tt2")})})(e)}Pg.displayName="toml";Pg.aliases=[];function Pg(e){(function(t){var n=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function r(s){return s.replace(/__/g,function(){return n})}t.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(r(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(r(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:false|true)\b/,punctuation:/[.,=[\]{}]/}})(e)}Bg.displayName="tremor";Bg.aliases=["trickle","troy"];function Bg(e){(function(t){t.languages.tremor={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/,lookbehind:!0},"interpolated-string":null,extractor:{pattern:/\b[a-z_]\w*\|(?:[^\r\n\\|]|\\(?:\r\n|[\s\S]))*\|/i,greedy:!0,inside:{regex:{pattern:/(^re)\|[\s\S]+/,lookbehind:!0},function:/^\w+/,value:/\|[\s\S]+/}},identifier:{pattern:/`[^`]*`/,greedy:!0},function:/\b[a-z_]\w*(?=\s*(?:::\s*<|\())\b/,keyword:/\b(?:args|as|by|case|config|connect|connector|const|copy|create|default|define|deploy|drop|each|emit|end|erase|event|flow|fn|for|from|group|having|insert|into|intrinsic|let|links|match|merge|mod|move|of|operator|patch|pipeline|recur|script|select|set|sliding|state|stream|to|tumbling|update|use|when|where|window|with)\b/,boolean:/\b(?:false|null|true)\b/i,number:/\b(?:0b[01_]*|0x[0-9a-fA-F_]*|\d[\d_]*(?:\.\d[\d_]*)?(?:[Ee][+-]?[\d_]+)?)\b/,"pattern-punctuation":{pattern:/%(?=[({[])/,alias:"punctuation"},operator:/[-+*\/%~!^]=?|=[=>]?|&[&=]?|\|[|=]?|<<?=?|>>?>?=?|(?:absent|and|not|or|present|xor)\b/,punctuation:/::|[;\[\]()\{\},.:]/};var n=/#\{(?:[^"{}]|\{[^{}]*\}|"(?:[^"\\\r\n]|\\(?:\r\n|[\s\S]))*")*\}/.source;t.languages.tremor["interpolated-string"]={pattern:RegExp(/(^|[^\\])/.source+'(?:"""(?:'+/[^"\\#]|\\[\s\S]|"(?!"")|#(?!\{)/.source+"|"+n+')*"""|"(?:'+/[^"\\\r\n#]|\\(?:\r\n|[\s\S])|#(?!\{)/.source+"|"+n+')*")'),lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:RegExp(n),inside:{punctuation:/^#\{|\}$/,expression:{pattern:/[\s\S]+/,inside:t.languages.tremor}}},string:/[\s\S]+/}},t.languages.troy=t.languages.tremor,t.languages.trickle=t.languages.tremor})(e)}Ug.displayName="typoscript";Ug.aliases=["tsconfig"];function Ug(e){(function(t){var n=/\b(?:ACT|ACTIFSUB|CARRAY|CASE|CLEARGIF|COA|COA_INT|CONSTANTS|CONTENT|CUR|EDITPANEL|EFFECT|EXT|FILE|FLUIDTEMPLATE|FORM|FRAME|FRAMESET|GIFBUILDER|GMENU|GMENU_FOLDOUT|GMENU_LAYERS|GP|HMENU|HRULER|HTML|IENV|IFSUB|IMAGE|IMGMENU|IMGMENUITEM|IMGTEXT|IMG_RESOURCE|INCLUDE_TYPOSCRIPT|JSMENU|JSMENUITEM|LLL|LOAD_REGISTER|NO|PAGE|RECORDS|RESTORE_REGISTER|TEMPLATE|TEXT|TMENU|TMENUITEM|TMENU_LAYERS|USER|USER_INT|_GIFBUILDER|global|globalString|globalVar)\b/;t.languages.typoscript={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:= \t]|(?:^|[^= \t])[ \t]+)\/\/.*/,lookbehind:!0,greedy:!0},{pattern:/(^|[^"'])#.*/,lookbehind:!0,greedy:!0}],function:[{pattern:/<INCLUDE_TYPOSCRIPT:\s*source\s*=\s*(?:"[^"\r\n]*"|'[^'\r\n]*')\s*>/,inside:{string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,inside:{keyword:n}},keyword:{pattern:/INCLUDE_TYPOSCRIPT/}}},{pattern:/@import\s*(?:"[^"\r\n]*"|'[^'\r\n]*')/,inside:{string:/"[^"\r\n]*"|'[^'\r\n]*'/}}],string:{pattern:/^([^=]*=[< ]?)(?:(?!\]\n).)*/,lookbehind:!0,inside:{function:/\{\$.*\}/,keyword:n,number:/^\d+$/,punctuation:/[,|:]/}},keyword:n,number:{pattern:/\b\d+\s*[.{=]/,inside:{operator:/[.{=]/}},tag:{pattern:/\.?[-\w\\]+\.?/,inside:{punctuation:/\./}},punctuation:/[{}[\];(),.:|]/,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/},t.languages.tsconfig=t.languages.typoscript})(e)}$g.displayName="unrealscript";$g.aliases=["uc","uscript"];function $g(e){e.languages.unrealscript={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},category:{pattern:/(\b(?:(?:autoexpand|hide|show)categories|var)\s*\()[^()]+(?=\))/,lookbehind:!0,greedy:!0,alias:"property"},metadata:{pattern:/(\w\s*)<\s*\w+\s*=[^<>|=\r\n]+(?:\|\s*\w+\s*=[^<>|=\r\n]+)*>/,lookbehind:!0,greedy:!0,inside:{property:/\b\w+(?=\s*=)/,operator:/=/,punctuation:/[<>|]/}},macro:{pattern:/`\w+/,alias:"property"},"class-name":{pattern:/(\b(?:class|enum|extends|interface|state(?:\(\))?|struct|within)\s+)\w+/,lookbehind:!0},keyword:/\b(?:abstract|actor|array|auto|autoexpandcategories|bool|break|byte|case|class|classgroup|client|coerce|collapsecategories|config|const|continue|default|defaultproperties|delegate|dependson|deprecated|do|dontcollapsecategories|editconst|editinlinenew|else|enum|event|exec|export|extends|final|float|for|forcescriptorder|foreach|function|goto|guid|hidecategories|hidedropdown|if|ignores|implements|inherits|input|int|interface|iterator|latent|local|material|name|native|nativereplication|noexport|nontransient|noteditinlinenew|notplaceable|operator|optional|out|pawn|perobjectconfig|perobjectlocalized|placeable|postoperator|preoperator|private|protected|reliable|replication|return|server|showcategories|simulated|singular|state|static|string|struct|structdefault|structdefaultproperties|switch|texture|transient|travel|unreliable|until|var|vector|while|within)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,boolean:/\b(?:false|true)\b/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/>>|<<|--|\+\+|\*\*|[-+*/~!=<>$@]=?|&&?|\|\|?|\^\^?|[?:%]|\b(?:ClockwiseFrom|Cross|Dot)\b/,punctuation:/[()[\]{};,.]/},e.languages.uc=e.languages.uscript=e.languages.unrealscript}zg.displayName="uorazor";zg.aliases=[];function zg(e){e.languages.uorazor={"comment-hash":{pattern:/#.*/,alias:"comment",greedy:!0},"comment-slash":{pattern:/\/\/.*/,alias:"comment",greedy:!0},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,inside:{punctuation:/^['"]|['"]$/},greedy:!0},"source-layers":{pattern:/\b(?:arms|backpack|blue|bracelet|cancel|clear|cloak|criminal|earrings|enemy|facialhair|friend|friendly|gloves|gray|grey|ground|hair|head|innerlegs|innertorso|innocent|lefthand|middletorso|murderer|neck|nonfriendly|onehandedsecondary|outerlegs|outertorso|pants|red|righthand|ring|self|shirt|shoes|talisman|waist)\b/i,alias:"function"},"source-commands":{pattern:/\b(?:alliance|attack|cast|clearall|clearignore|clearjournal|clearlist|clearsysmsg|createlist|createtimer|dclick|dclicktype|dclickvar|dress|dressconfig|drop|droprelloc|emote|getlabel|guild|gumpclose|gumpresponse|hotkey|ignore|lasttarget|lift|lifttype|menu|menuresponse|msg|org|organize|organizer|overhead|pause|poplist|potion|promptresponse|pushlist|removelist|removetimer|rename|restock|say|scav|scavenger|script|setability|setlasttarget|setskill|settimer|setvar|sysmsg|target|targetloc|targetrelloc|targettype|undress|unignore|unsetvar|useobject|useonce|useskill|usetype|virtue|wait|waitforgump|waitformenu|waitforprompt|waitforstat|waitforsysmsg|waitfortarget|walk|wfsysmsg|wft|whisper|yell)\b/,alias:"function"},"tag-name":{pattern:/(^\{%-?\s*)\w+/,lookbehind:!0,alias:"keyword"},delimiter:{pattern:/^\{[{%]-?|-?[%}]\}$/,alias:"punctuation"},function:/\b(?:atlist|close|closest|count|counter|counttype|dead|dex|diffhits|diffmana|diffstam|diffweight|find|findbuff|finddebuff|findlayer|findtype|findtypelist|followers|gumpexists|hidden|hits|hp|hue|human|humanoid|ingump|inlist|insysmessage|insysmsg|int|invul|lhandempty|list|listexists|mana|maxhits|maxhp|maxmana|maxstam|maxweight|monster|mounted|name|next|noto|paralyzed|poisoned|position|prev|previous|queued|rand|random|rhandempty|skill|stam|str|targetexists|timer|timerexists|varexist|warmode|weight)\b/,keyword:/\b(?:and|as|break|continue|else|elseif|endfor|endif|endwhile|for|if|loop|not|or|replay|stop|while)\b/,boolean:/\b(?:false|null|true)\b/,number:/\b0x[\dA-Fa-f]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][-+]?\d+)?/,operator:[{pattern:/(\s)(?:and|b-and|b-or|b-xor|ends with|in|is|matches|not|or|same as|starts with)(?=\s)/,lookbehind:!0},/[=<>]=?|!=|\*\*?|\/\/?|\?:?|[-+~%|]/],punctuation:/[()\[\]{}:.,]/}}Hg.displayName="v";Hg.aliases=[];function Hg(e){e.register(rt),(function(t){var n={pattern:/[\s\S]+/,inside:null};t.languages.v=t.languages.extend("clike",{string:{pattern:/r?(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,alias:"quoted-string",greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\{[^{}]*\}|\w+(?:\.\w+(?:\([^\(\)]*\))?|\[[^\[\]]+\])*)/,lookbehind:!0,inside:{"interpolation-variable":{pattern:/^\$\w[\s\S]*$/,alias:"variable"},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},"interpolation-expression":n}}}},"class-name":{pattern:/(\b(?:enum|interface|struct|type)\s+)(?:C\.)?\w+/,lookbehind:!0},keyword:/(?:\b(?:__global|as|asm|assert|atomic|break|chan|const|continue|defer|else|embed|enum|fn|for|go(?:to)?|if|import|in|interface|is|lock|match|module|mut|none|or|pub|return|rlock|select|shared|sizeof|static|struct|type(?:of)?|union|unsafe)|\$(?:else|for|if)|#(?:flag|include))\b/,number:/\b(?:0x[a-f\d]+(?:_[a-f\d]+)*|0b[01]+(?:_[01]+)*|0o[0-7]+(?:_[0-7]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?)\b/i,operator:/~|\?|[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\.?/,builtin:/\b(?:any(?:_float|_int)?|bool|byte(?:ptr)?|charptr|f(?:32|64)|i(?:8|16|64|128|nt)|rune|size_t|string|u(?:16|32|64|128)|voidptr)\b/}),n.inside=t.languages.v,t.languages.insertBefore("v","string",{char:{pattern:/`(?:\\`|\\?[^`]{1,2})`/,alias:"rune"}}),t.languages.insertBefore("v","operator",{attribute:{pattern:/(^[\t ]*)\[(?:deprecated|direct_array_access|flag|inline|live|ref_only|typedef|unsafe_fn|windows_stdcall)\]/m,lookbehind:!0,alias:"annotation",inside:{punctuation:/[\[\]]/,keyword:/\w+/}},generic:{pattern:/<\w+>(?=\s*[\)\{])/,inside:{punctuation:/[<>]/,"class-name":/\w+/}}}),t.languages.insertBefore("v","function",{"generic-function":{pattern:/\b\w+\s*<\w+>(?=\()/,inside:{function:/^\w+/,generic:{pattern:/<\w+>/,inside:t.languages.v.generic.inside}}}})})(e)}Gg.displayName="vala";Gg.aliases=[];function Gg(e){e.register(rt),e.languages.vala=e.languages.extend("clike",{"class-name":[{pattern:/\b[A-Z]\w*(?:\.\w+)*\b(?=(?:\?\s+|\*?\s+\*?)\w)/,inside:{punctuation:/\./}},{pattern:/(\[)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/((?:\b(?:class|enum|interface|new|struct)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}}],keyword:/\b(?:abstract|as|assert|async|base|bool|break|case|catch|char|class|const|construct|continue|default|delegate|delete|do|double|dynamic|else|ensures|enum|errordomain|extern|finally|float|for|foreach|get|if|in|inline|int|int16|int32|int64|int8|interface|internal|is|lock|long|namespace|new|null|out|override|owned|params|private|protected|public|ref|requires|return|set|short|signal|sizeof|size_t|ssize_t|static|string|struct|switch|this|throw|throws|try|typeof|uchar|uint|uint16|uint32|uint64|uint8|ulong|unichar|unowned|ushort|using|value|var|virtual|void|volatile|weak|while|yield)\b/i,function:/\b\w+(?=\s*\()/,number:/(?:\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)(?:f|u?l?)?/i,operator:/\+\+|--|&&|\|\||<<=?|>>=?|=>|->|~|[+\-*\/%&^|=!<>]=?|\?\??|\.\.\./,punctuation:/[{}[\];(),.:]/,constant:/\b[A-Z0-9_]+\b/}),e.languages.insertBefore("vala","string",{"raw-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},"template-string":{pattern:/@"[\s\S]*?"/,greedy:!0,inside:{interpolation:{pattern:/\$(?:\([^)]*\)|[a-zA-Z]\w*)/,inside:{delimiter:{pattern:/^\$\(?|\)$/,alias:"punctuation"},rest:e.languages.vala}},string:/[\s\S]+/}}}),e.languages.insertBefore("vala","keyword",{regex:{pattern:/\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[imsx]{0,4}(?=\s*(?:$|[\r\n,.;})\]]))/,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:e.languages.regex},"regex-delimiter":/^\//,"regex-flags":/^[a-z]+$/}}})}Wg.displayName="velocity";Wg.aliases=[];function Wg(e){e.register(rn),(function(t){t.languages.velocity=t.languages.extend("markup",{});var n={variable:{pattern:/(^|[^\\](?:\\\\)*)\$!?(?:[a-z][\w-]*(?:\([^)]*\))?(?:\.[a-z][\w-]*(?:\([^)]*\))?|\[[^\]]+\])*|\{[^}]+\})/i,lookbehind:!0,inside:{}},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},number:/\b\d+\b/,boolean:/\b(?:false|true)\b/,operator:/[=!<>]=?|[+*/%-]|&&|\|\||\.\.|\b(?:eq|g[et]|l[et]|n(?:e|ot))\b/,punctuation:/[(){}[\]:,.]/};n.variable.inside={string:n.string,function:{pattern:/([^\w-])[a-z][\w-]*(?=\()/,lookbehind:!0},number:n.number,boolean:n.boolean,punctuation:n.punctuation},t.languages.insertBefore("velocity","comment",{unparsed:{pattern:/(^|[^\\])#\[\[[\s\S]*?\]\]#/,lookbehind:!0,greedy:!0,inside:{punctuation:/^#\[\[|\]\]#$/}},"velocity-comment":[{pattern:/(^|[^\\])#\*[\s\S]*?\*#/,lookbehind:!0,greedy:!0,alias:"comment"},{pattern:/(^|[^\\])##.*/,lookbehind:!0,greedy:!0,alias:"comment"}],directive:{pattern:/(^|[^\\](?:\\\\)*)#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})(?:\s*\((?:[^()]|\([^()]*\))*\))?/i,lookbehind:!0,inside:{keyword:{pattern:/^#@?(?:[a-z][\w-]*|\{[a-z][\w-]*\})|\bin\b/,inside:{punctuation:/[{}]/}},rest:n}},variable:n.variable}),t.languages.velocity.tag.inside["attr-value"].inside.rest=t.languages.velocity})(e)}qg.displayName="verilog";qg.aliases=[];function qg(e){e.languages.verilog={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"kernel-function":{pattern:/\B\$\w+\b/,alias:"property"},constant:/\B`\w+\b/,function:/\b\w+(?=\()/,keyword:/\b(?:alias|and|assert|assign|assume|automatic|before|begin|bind|bins|binsof|bit|break|buf|bufif0|bufif1|byte|case|casex|casez|cell|chandle|class|clocking|cmos|config|const|constraint|context|continue|cover|covergroup|coverpoint|cross|deassign|default|defparam|design|disable|dist|do|edge|else|end|endcase|endclass|endclocking|endconfig|endfunction|endgenerate|endgroup|endinterface|endmodule|endpackage|endprimitive|endprogram|endproperty|endsequence|endspecify|endtable|endtask|enum|event|expect|export|extends|extern|final|first_match|for|force|foreach|forever|fork|forkjoin|function|generate|genvar|highz0|highz1|if|iff|ifnone|ignore_bins|illegal_bins|import|incdir|include|initial|inout|input|inside|instance|int|integer|interface|intersect|join|join_any|join_none|large|liblist|library|local|localparam|logic|longint|macromodule|matches|medium|modport|module|nand|negedge|new|nmos|nor|noshowcancelled|not|notif0|notif1|null|or|output|package|packed|parameter|pmos|posedge|primitive|priority|program|property|protected|pull0|pull1|pulldown|pullup|pulsestyle_ondetect|pulsestyle_onevent|pure|rand|randc|randcase|randsequence|rcmos|real|realtime|ref|reg|release|repeat|return|rnmos|rpmos|rtran|rtranif0|rtranif1|scalared|sequence|shortint|shortreal|showcancelled|signed|small|solve|specify|specparam|static|string|strong0|strong1|struct|super|supply0|supply1|table|tagged|task|this|throughout|time|timeprecision|timeunit|tran|tranif0|tranif1|tri|tri0|tri1|triand|trior|trireg|type|typedef|union|unique|unsigned|use|uwire|var|vectored|virtual|void|wait|wait_order|wand|weak0|weak1|while|wildcard|wire|with|within|wor|xnor|xor)\b/,important:/\b(?:always|always_comb|always_ff|always_latch)\b(?: *@)?/,number:/\B##?\d+|(?:\b\d+)?'[odbh] ?[\da-fzx_?]+|\b(?:\d*[._])?\d+(?:e[-+]?\d+)?/i,operator:/[-+{}^~%*\/?=!<>&|]+/,punctuation:/[[\];(),.:]/}}Vg.displayName="vhdl";Vg.aliases=[];function Vg(e){e.languages.vhdl={comment:/--.+/,"vhdl-vectors":{pattern:/\b[oxb]"[\da-f_]+"|"[01uxzwlh-]+"/i,alias:"number"},"quoted-function":{pattern:/"\S+?"(?=\()/,alias:"function"},string:/"(?:[^\\"\r\n]|\\(?:\r\n|[\s\S]))*"/,attribute:{pattern:/\b'\w+/,alias:"attr-name"},keyword:/\b(?:access|after|alias|all|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|new|next|null|of|on|open|others|out|package|port|postponed|private|procedure|process|pure|range|record|register|reject|report|return|select|severity|shared|signal|subtype|then|to|transport|type|unaffected|units|until|use|variable|view|wait|when|while|with)\b/i,boolean:/\b(?:false|true)\b/i,function:/\w+(?=\()/,number:/'[01uxzwlh-]'|\b(?:\d+#[\da-f_.]+#|\d[\d_.]*)(?:e[-+]?\d+)?/i,operator:/[<>]=?|:=|[-+*/&=]|\b(?:abs|and|mod|nand|nor|not|or|rem|rol|ror|sla|sll|sra|srl|xnor|xor)\b/i,punctuation:/[{}[\];(),.:]/}}Yg.displayName="vim";Yg.aliases=[];function Yg(e){e.languages.vim={string:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\r\n]|'')*'/,comment:/".*/,function:/\b\w+(?=\()/,keyword:/\b(?:N|Next|P|Print|X|XMLent|XMLns|ab|abbreviate|abc|abclear|abo|aboveleft|al|all|ar|arga|argadd|argd|argdelete|argdo|arge|argedit|argg|argglobal|argl|arglocal|args|argu|argument|as|ascii|b|bN|bNext|ba|bad|badd|ball|bd|bdelete|be|bel|belowright|bf|bfirst|bl|blast|bm|bmodified|bn|bnext|bo|botright|bp|bprevious|br|brea|break|breaka|breakadd|breakd|breakdel|breakl|breaklist|brewind|bro|browse|bufdo|buffer|buffers|bun|bunload|bw|bwipeout|c|cN|cNext|cNfcNfile|ca|cabbrev|cabc|cabclear|cad|caddb|caddbuffer|caddexpr|caddf|caddfile|cal|call|cat|catch|cb|cbuffer|cc|ccl|cclose|cd|ce|center|cex|cexpr|cf|cfile|cfir|cfirst|cg|cgetb|cgetbuffer|cgete|cgetexpr|cgetfile|change|changes|chd|chdir|che|checkpath|checkt|checktime|cl|cla|clast|clist|clo|close|cmapc|cmapclear|cn|cnew|cnewer|cnext|cnf|cnfile|cnorea|cnoreabbrev|co|col|colder|colo|colorscheme|comc|comclear|comp|compiler|con|conf|confirm|continue|cope|copen|copy|cp|cpf|cpfile|cprevious|cq|cquit|cr|crewind|cu|cuna|cunabbrev|cunmap|cw|cwindow|d|debugg|debuggreedy|delc|delcommand|delete|delf|delfunction|delm|delmarks|di|diffg|diffget|diffoff|diffpatch|diffpu|diffput|diffsplit|diffthis|diffu|diffupdate|dig|digraphs|display|dj|djump|dl|dlist|dr|drop|ds|dsearch|dsp|dsplit|e|earlier|echoe|echoerr|echom|echomsg|echon|edit|el|else|elsei|elseif|em|emenu|en|endf|endfo|endfor|endfun|endfunction|endif|endt|endtry|endw|endwhile|ene|enew|ex|exi|exit|exu|exusage|f|file|files|filetype|fin|fina|finally|find|fini|finish|fir|first|fix|fixdel|fo|fold|foldc|foldclose|foldd|folddoc|folddoclosed|folddoopen|foldo|foldopen|for|fu|fun|function|go|goto|gr|grep|grepa|grepadd|h|ha|hardcopy|help|helpf|helpfind|helpg|helpgrep|helpt|helptags|hid|hide|his|history|ia|iabbrev|iabc|iabclear|if|ij|ijump|il|ilist|imapc|imapclear|in|inorea|inoreabbrev|isearch|isp|isplit|iu|iuna|iunabbrev|iunmap|j|join|ju|jumps|k|kee|keepalt|keepj|keepjumps|keepmarks|l|lN|lNext|lNf|lNfile|la|lad|laddb|laddbuffer|laddexpr|laddf|laddfile|lan|language|last|later|lb|lbuffer|lc|lcd|lch|lchdir|lcl|lclose|left|lefta|leftabove|let|lex|lexpr|lf|lfile|lfir|lfirst|lg|lgetb|lgetbuffer|lgete|lgetexpr|lgetfile|lgr|lgrep|lgrepa|lgrepadd|lh|lhelpgrep|list|ll|lla|llast|lli|llist|lm|lmak|lmake|lmap|lmapc|lmapclear|ln|lne|lnew|lnewer|lnext|lnf|lnfile|lnoremap|lo|loadview|loc|lockmarks|lockv|lockvar|lol|lolder|lop|lopen|lp|lpf|lpfile|lprevious|lr|lrewind|ls|lt|ltag|lu|lunmap|lv|lvimgrep|lvimgrepa|lvimgrepadd|lw|lwindow|m|ma|mak|make|mark|marks|mat|match|menut|menutranslate|mk|mkexrc|mks|mksession|mksp|mkspell|mkv|mkvie|mkview|mkvimrc|mod|mode|move|mz|mzf|mzfile|mzscheme|n|nbkey|new|next|nmapc|nmapclear|noh|nohlsearch|norea|noreabbrev|nu|number|nun|nunmap|o|omapc|omapclear|on|only|open|opt|options|ou|ounmap|p|pc|pclose|pe|ped|pedit|perl|perld|perldo|po|pop|popu|popup|pp|ppop|pre|preserve|prev|previous|print|prof|profd|profdel|profile|promptf|promptfind|promptr|promptrepl|ps|psearch|ptN|ptNext|pta|ptag|ptf|ptfirst|ptj|ptjump|ptl|ptlast|ptn|ptnext|ptp|ptprevious|ptr|ptrewind|pts|ptselect|pu|put|pw|pwd|py|pyf|pyfile|python|q|qa|qall|quit|quita|quitall|r|read|rec|recover|red|redi|redir|redo|redr|redraw|redraws|redrawstatus|reg|registers|res|resize|ret|retab|retu|return|rew|rewind|ri|right|rightb|rightbelow|ru|rub|ruby|rubyd|rubydo|rubyf|rubyfile|runtime|rv|rviminfo|sN|sNext|sa|sal|sall|san|sandbox|sargument|sav|saveas|sb|sbN|sbNext|sba|sball|sbf|sbfirst|sbl|sblast|sbm|sbmodified|sbn|sbnext|sbp|sbprevious|sbr|sbrewind|sbuffer|scrip|scripte|scriptencoding|scriptnames|se|set|setf|setfiletype|setg|setglobal|setl|setlocal|sf|sfind|sfir|sfirst|sh|shell|sign|sil|silent|sim|simalt|sl|sla|slast|sleep|sm|smagic|smap|smapc|smapclear|sme|smenu|sn|snext|sni|sniff|sno|snomagic|snor|snoremap|snoreme|snoremenu|so|sor|sort|source|sp|spe|spelld|spelldump|spellgood|spelli|spellinfo|spellr|spellrepall|spellu|spellundo|spellw|spellwrong|split|spr|sprevious|sre|srewind|st|sta|stag|star|startg|startgreplace|startinsert|startr|startreplace|stj|stjump|stop|stopi|stopinsert|sts|stselect|sun|sunhide|sunm|sunmap|sus|suspend|sv|sview|syncbind|t|tN|tNext|ta|tab|tabN|tabNext|tabc|tabclose|tabd|tabdo|tabe|tabedit|tabf|tabfind|tabfir|tabfirst|tabl|tablast|tabm|tabmove|tabn|tabnew|tabnext|tabo|tabonly|tabp|tabprevious|tabr|tabrewind|tabs|tag|tags|tc|tcl|tcld|tcldo|tclf|tclfile|te|tearoff|tf|tfirst|th|throw|tj|tjump|tl|tlast|tm|tmenu|tn|tnext|to|topleft|tp|tprevious|tr|trewind|try|ts|tselect|tu|tunmenu|u|una|unabbreviate|undo|undoj|undojoin|undol|undolist|unh|unhide|unlet|unlo|unlockvar|unm|unmap|up|update|ve|verb|verbose|version|vert|vertical|vi|vie|view|vim|vimgrep|vimgrepa|vimgrepadd|visual|viu|viusage|vmapc|vmapclear|vne|vnew|vs|vsplit|vu|vunmap|w|wN|wNext|wa|wall|wh|while|win|winc|wincmd|windo|winp|winpos|winsize|wn|wnext|wp|wprevious|wq|wqa|wqall|write|ws|wsverb|wv|wviminfo|x|xa|xall|xit|xm|xmap|xmapc|xmapclear|xme|xmenu|xn|xnoremap|xnoreme|xnoremenu|xu|xunmap|y|yank)\b/,builtin:/\b(?:acd|ai|akm|aleph|allowrevins|altkeymap|ambiwidth|ambw|anti|antialias|arab|arabic|arabicshape|ari|arshape|autochdir|autocmd|autoindent|autoread|autowrite|autowriteall|aw|awa|background|backspace|backup|backupcopy|backupdir|backupext|backupskip|balloondelay|ballooneval|balloonexpr|bdir|bdlay|beval|bex|bexpr|bg|bh|bin|binary|biosk|bioskey|bk|bkc|bomb|breakat|brk|browsedir|bs|bsdir|bsk|bt|bufhidden|buflisted|buftype|casemap|ccv|cdpath|cedit|cfu|ch|charconvert|ci|cin|cindent|cink|cinkeys|cino|cinoptions|cinw|cinwords|clipboard|cmdheight|cmdwinheight|cmp|cms|columns|com|comments|commentstring|compatible|complete|completefunc|completeopt|consk|conskey|copyindent|cot|cpo|cpoptions|cpt|cscopepathcomp|cscopeprg|cscopequickfix|cscopetag|cscopetagorder|cscopeverbose|cspc|csprg|csqf|cst|csto|csverb|cuc|cul|cursorcolumn|cursorline|cwh|debug|deco|def|define|delcombine|dex|dg|dict|dictionary|diff|diffexpr|diffopt|digraph|dip|dir|directory|dy|ea|ead|eadirection|eb|ed|edcompatible|ef|efm|ei|ek|enc|encoding|endofline|eol|ep|equalalways|equalprg|errorbells|errorfile|errorformat|esckeys|et|eventignore|expandtab|exrc|fcl|fcs|fdc|fde|fdi|fdl|fdls|fdm|fdn|fdo|fdt|fen|fenc|fencs|fex|ff|ffs|fileencoding|fileencodings|fileformat|fileformats|fillchars|fk|fkmap|flp|fml|fmr|foldcolumn|foldenable|foldexpr|foldignore|foldlevel|foldlevelstart|foldmarker|foldmethod|foldminlines|foldnestmax|foldtext|formatexpr|formatlistpat|formatoptions|formatprg|fp|fs|fsync|ft|gcr|gd|gdefault|gfm|gfn|gfs|gfw|ghr|gp|grepformat|grepprg|gtl|gtt|guicursor|guifont|guifontset|guifontwide|guiheadroom|guioptions|guipty|guitablabel|guitabtooltip|helpfile|helpheight|helplang|hf|hh|hi|hidden|highlight|hk|hkmap|hkmapp|hkp|hl|hlg|hls|hlsearch|ic|icon|iconstring|ignorecase|im|imactivatekey|imak|imc|imcmdline|imd|imdisable|imi|iminsert|ims|imsearch|inc|include|includeexpr|incsearch|inde|indentexpr|indentkeys|indk|inex|inf|infercase|insertmode|invacd|invai|invakm|invallowrevins|invaltkeymap|invanti|invantialias|invar|invarab|invarabic|invarabicshape|invari|invarshape|invautochdir|invautoindent|invautoread|invautowrite|invautowriteall|invaw|invawa|invbackup|invballooneval|invbeval|invbin|invbinary|invbiosk|invbioskey|invbk|invbl|invbomb|invbuflisted|invcf|invci|invcin|invcindent|invcompatible|invconfirm|invconsk|invconskey|invcopyindent|invcp|invcscopetag|invcscopeverbose|invcst|invcsverb|invcuc|invcul|invcursorcolumn|invcursorline|invdeco|invdelcombine|invdg|invdiff|invdigraph|invdisable|invea|inveb|inved|invedcompatible|invek|invendofline|inveol|invequalalways|inverrorbells|invesckeys|invet|invex|invexpandtab|invexrc|invfen|invfk|invfkmap|invfoldenable|invgd|invgdefault|invguipty|invhid|invhidden|invhk|invhkmap|invhkmapp|invhkp|invhls|invhlsearch|invic|invicon|invignorecase|invim|invimc|invimcmdline|invimd|invincsearch|invinf|invinfercase|invinsertmode|invis|invjoinspaces|invjs|invlazyredraw|invlbr|invlinebreak|invlisp|invlist|invloadplugins|invlpl|invlz|invma|invmacatsui|invmagic|invmh|invml|invmod|invmodeline|invmodifiable|invmodified|invmore|invmousef|invmousefocus|invmousehide|invnu|invnumber|invodev|invopendevice|invpaste|invpi|invpreserveindent|invpreviewwindow|invprompt|invpvw|invreadonly|invremap|invrestorescreen|invrevins|invri|invrightleft|invrightleftcmd|invrl|invrlc|invro|invrs|invru|invruler|invsb|invsc|invscb|invscrollbind|invscs|invsecure|invsft|invshellslash|invshelltemp|invshiftround|invshortname|invshowcmd|invshowfulltag|invshowmatch|invshowmode|invsi|invsm|invsmartcase|invsmartindent|invsmarttab|invsmd|invsn|invsol|invspell|invsplitbelow|invsplitright|invspr|invsr|invssl|invsta|invstartofline|invstmp|invswapfile|invswf|invta|invtagbsearch|invtagrelative|invtagstack|invtbi|invtbidi|invtbs|invtermbidi|invterse|invtextauto|invtextmode|invtf|invtgst|invtildeop|invtimeout|invtitle|invto|invtop|invtr|invttimeout|invttybuiltin|invttyfast|invtx|invvb|invvisualbell|invwa|invwarn|invwb|invweirdinvert|invwfh|invwfw|invwildmenu|invwinfixheight|invwinfixwidth|invwiv|invwmnu|invwrap|invwrapscan|invwrite|invwriteany|invwritebackup|invws|isf|isfname|isi|isident|isk|iskeyword|isprint|joinspaces|js|key|keymap|keymodel|keywordprg|km|kmp|kp|langmap|langmenu|laststatus|lazyredraw|lbr|lcs|linebreak|lines|linespace|lisp|lispwords|listchars|loadplugins|lpl|lsp|lz|macatsui|magic|makeef|makeprg|matchpairs|matchtime|maxcombine|maxfuncdepth|maxmapdepth|maxmem|maxmempattern|maxmemtot|mco|mef|menuitems|mfd|mh|mis|mkspellmem|ml|mls|mm|mmd|mmp|mmt|modeline|modelines|modifiable|modified|more|mouse|mousef|mousefocus|mousehide|mousem|mousemodel|mouses|mouseshape|mouset|mousetime|mp|mps|msm|mzq|mzquantum|nf|noacd|noai|noakm|noallowrevins|noaltkeymap|noanti|noantialias|noar|noarab|noarabic|noarabicshape|noari|noarshape|noautochdir|noautoindent|noautoread|noautowrite|noautowriteall|noaw|noawa|nobackup|noballooneval|nobeval|nobin|nobinary|nobiosk|nobioskey|nobk|nobl|nobomb|nobuflisted|nocf|noci|nocin|nocindent|nocompatible|noconfirm|noconsk|noconskey|nocopyindent|nocp|nocscopetag|nocscopeverbose|nocst|nocsverb|nocuc|nocul|nocursorcolumn|nocursorline|nodeco|nodelcombine|nodg|nodiff|nodigraph|nodisable|noea|noeb|noed|noedcompatible|noek|noendofline|noeol|noequalalways|noerrorbells|noesckeys|noet|noex|noexpandtab|noexrc|nofen|nofk|nofkmap|nofoldenable|nogd|nogdefault|noguipty|nohid|nohidden|nohk|nohkmap|nohkmapp|nohkp|nohls|noic|noicon|noignorecase|noim|noimc|noimcmdline|noimd|noincsearch|noinf|noinfercase|noinsertmode|nois|nojoinspaces|nojs|nolazyredraw|nolbr|nolinebreak|nolisp|nolist|noloadplugins|nolpl|nolz|noma|nomacatsui|nomagic|nomh|noml|nomod|nomodeline|nomodifiable|nomodified|nomore|nomousef|nomousefocus|nomousehide|nonu|nonumber|noodev|noopendevice|nopaste|nopi|nopreserveindent|nopreviewwindow|noprompt|nopvw|noreadonly|noremap|norestorescreen|norevins|nori|norightleft|norightleftcmd|norl|norlc|noro|nors|noru|noruler|nosb|nosc|noscb|noscrollbind|noscs|nosecure|nosft|noshellslash|noshelltemp|noshiftround|noshortname|noshowcmd|noshowfulltag|noshowmatch|noshowmode|nosi|nosm|nosmartcase|nosmartindent|nosmarttab|nosmd|nosn|nosol|nospell|nosplitbelow|nosplitright|nospr|nosr|nossl|nosta|nostartofline|nostmp|noswapfile|noswf|nota|notagbsearch|notagrelative|notagstack|notbi|notbidi|notbs|notermbidi|noterse|notextauto|notextmode|notf|notgst|notildeop|notimeout|notitle|noto|notop|notr|nottimeout|nottybuiltin|nottyfast|notx|novb|novisualbell|nowa|nowarn|nowb|noweirdinvert|nowfh|nowfw|nowildmenu|nowinfixheight|nowinfixwidth|nowiv|nowmnu|nowrap|nowrapscan|nowrite|nowriteany|nowritebackup|nows|nrformats|numberwidth|nuw|odev|oft|ofu|omnifunc|opendevice|operatorfunc|opfunc|osfiletype|pa|para|paragraphs|paste|pastetoggle|patchexpr|patchmode|path|pdev|penc|pex|pexpr|pfn|ph|pheader|pi|pm|pmbcs|pmbfn|popt|preserveindent|previewheight|previewwindow|printdevice|printencoding|printexpr|printfont|printheader|printmbcharset|printmbfont|printoptions|prompt|pt|pumheight|pvh|pvw|qe|quoteescape|readonly|remap|report|restorescreen|revins|rightleft|rightleftcmd|rl|rlc|ro|rs|rtp|ruf|ruler|rulerformat|runtimepath|sbo|sc|scb|scr|scroll|scrollbind|scrolljump|scrolloff|scrollopt|scs|sect|sections|secure|sel|selection|selectmode|sessionoptions|sft|shcf|shellcmdflag|shellpipe|shellquote|shellredir|shellslash|shelltemp|shelltype|shellxquote|shiftround|shiftwidth|shm|shortmess|shortname|showbreak|showcmd|showfulltag|showmatch|showmode|showtabline|shq|si|sidescroll|sidescrolloff|siso|sj|slm|smartcase|smartindent|smarttab|smc|smd|softtabstop|sol|spc|spell|spellcapcheck|spellfile|spelllang|spellsuggest|spf|spl|splitbelow|splitright|sps|sr|srr|ss|ssl|ssop|stal|startofline|statusline|stl|stmp|su|sua|suffixes|suffixesadd|sw|swapfile|swapsync|swb|swf|switchbuf|sws|sxq|syn|synmaxcol|syntax|t_AB|t_AF|t_AL|t_CS|t_CV|t_Ce|t_Co|t_Cs|t_DL|t_EI|t_F1|t_F2|t_F3|t_F4|t_F5|t_F6|t_F7|t_F8|t_F9|t_IE|t_IS|t_K1|t_K3|t_K4|t_K5|t_K6|t_K7|t_K8|t_K9|t_KA|t_KB|t_KC|t_KD|t_KE|t_KF|t_KG|t_KH|t_KI|t_KJ|t_KK|t_KL|t_RI|t_RV|t_SI|t_Sb|t_Sf|t_WP|t_WS|t_ZH|t_ZR|t_al|t_bc|t_cd|t_ce|t_cl|t_cm|t_cs|t_da|t_db|t_dl|t_fs|t_k1|t_k2|t_k3|t_k4|t_k5|t_k6|t_k7|t_k8|t_k9|t_kB|t_kD|t_kI|t_kN|t_kP|t_kb|t_kd|t_ke|t_kh|t_kl|t_kr|t_ks|t_ku|t_le|t_mb|t_md|t_me|t_mr|t_ms|t_nd|t_op|t_se|t_so|t_sr|t_te|t_ti|t_ts|t_ue|t_us|t_ut|t_vb|t_ve|t_vi|t_vs|t_xs|tabline|tabpagemax|tabstop|tagbsearch|taglength|tagrelative|tagstack|tal|tb|tbi|tbidi|tbis|tbs|tenc|term|termbidi|termencoding|terse|textauto|textmode|textwidth|tgst|thesaurus|tildeop|timeout|timeoutlen|title|titlelen|titleold|titlestring|toolbar|toolbariconsize|top|tpm|tsl|tsr|ttimeout|ttimeoutlen|ttm|tty|ttybuiltin|ttyfast|ttym|ttymouse|ttyscroll|ttytype|tw|tx|uc|ul|undolevels|updatecount|updatetime|ut|vb|vbs|vdir|verbosefile|vfile|viewdir|viewoptions|viminfo|virtualedit|visualbell|vop|wak|warn|wb|wc|wcm|wd|weirdinvert|wfh|wfw|whichwrap|wi|wig|wildchar|wildcharm|wildignore|wildmenu|wildmode|wildoptions|wim|winaltkeys|window|winfixheight|winfixwidth|winheight|winminheight|winminwidth|winwidth|wiv|wiw|wm|wmh|wmnu|wmw|wop|wrap|wrapmargin|wrapscan|writeany|writebackup|writedelay|ww)\b/,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?)\b/i,operator:/\|\||&&|[-+.]=?|[=!](?:[=~][#?]?)?|[<>]=?[#?]?|[*\/%?]|\b(?:is(?:not)?)\b/,punctuation:/[{}[\](),;:]/}}Kg.displayName="visual-basic";Kg.aliases=["vb","vba"];function Kg(e){e.languages["visual-basic"]={comment:{pattern:/(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i,inside:{keyword:/^REM/i}},directive:{pattern:/#(?:Const|Else|ElseIf|End|ExternalChecksum|ExternalSource|If|Region)(?:\b_[ \t]*(?:\r\n?|\n)|.)+/i,alias:"property",greedy:!0},string:{pattern:/\$?["“”](?:["“”]{2}|[^"“”])*["“”]C?/i,greedy:!0},date:{pattern:/#[ \t]*(?:\d+([/-])\d+\1\d+(?:[ \t]+(?:\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?))?|\d+[ \t]*(?:AM|PM)|\d+:\d+(?::\d+)?(?:[ \t]*(?:AM|PM))?)[ \t]*#/i,alias:"number"},number:/(?:(?:\b\d+(?:\.\d+)?|\.\d+)(?:E[+-]?\d+)?|&[HO][\dA-F]+)(?:[FRD]|U?[ILS])?/i,boolean:/\b(?:False|Nothing|True)\b/i,keyword:/\b(?:AddHandler|AddressOf|Alias|And(?:Also)?|As|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|C(?:Bool|Byte|Char|Date|Dbl|Dec|Int|Lng|Obj|SByte|Short|Sng|Str|Type|UInt|ULng|UShort)|Char|Class|Const|Continue|Currency|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else(?:If)?|End(?:If)?|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get(?:Type|XMLNamespace)?|Global|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|IsNot|Let|Lib|Like|Long|Loop|Me|Mod|Module|Must(?:Inherit|Override)|My(?:Base|Class)|Namespace|Narrowing|New|Next|Not(?:Inheritable|Overridable)?|Object|Of|On|Operator|Option(?:al)?|Or(?:Else)?|Out|Overloads|Overridable|Overrides|ParamArray|Partial|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|SByte|Select|Set|Shadows|Shared|short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TryCast|Type|TypeOf|U(?:Integer|Long|Short)|Until|Using|Variant|Wend|When|While|Widening|With(?:Events)?|WriteOnly|Xor)\b/i,operator:/[+\-*/\\^<=>&#@$%!]|\b_(?=[ \t]*[\r\n])/,punctuation:/[{}().,:?]/},e.languages.vb=e.languages["visual-basic"],e.languages.vba=e.languages["visual-basic"]}Zg.displayName="warpscript";Zg.aliases=[];function Zg(e){e.languages.warpscript={comment:/#.*|\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'|<'(?:[^\\']|'(?!>)|\\.)*'>/,greedy:!0},variable:/\$\S+/,macro:{pattern:/@\S+/,alias:"property"},keyword:/\b(?:BREAK|CHECKMACRO|CONTINUE|CUDF|DEFINED|DEFINEDMACRO|EVAL|FAIL|FOR|FOREACH|FORSTEP|IFT|IFTE|MSGFAIL|NRETURN|RETHROW|RETURN|SWITCH|TRY|UDF|UNTIL|WHILE)\b/,number:/[+-]?\b(?:NaN|Infinity|\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?|0x[\da-fA-F]+|0b[01]+)\b/,boolean:/\b(?:F|T|false|true)\b/,punctuation:/<%|%>|[{}[\]()]/,operator:/==|&&?|\|\|?|\*\*?|>>>?|<<|[<>!~]=?|[-/%^]|\+!?|\b(?:AND|NOT|OR)\b/}}Xg.displayName="wasm";Xg.aliases=[];function Xg(e){e.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/}}Qg.displayName="web-idl";Qg.aliases=["webidl"];function Qg(e){(function(t){var n=/(?:\B-|\b_|\b)[A-Za-z][\w-]*(?![\w-])/.source,r="(?:"+/\b(?:unsigned\s+)?long\s+long(?![\w-])/.source+"|"+/\b(?:unrestricted|unsigned)\s+[a-z]+(?![\w-])/.source+"|"+/(?!(?:unrestricted|unsigned)\b)/.source+n+/(?:\s*<(?:[^<>]|<[^<>]*>)*>)?/.source+")"+/(?:\s*\?)?/.source,s={};t.languages["web-idl"]={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/"[^"]*"/,greedy:!0},namespace:{pattern:RegExp(/(\bnamespace\s+)/.source+n),lookbehind:!0},"class-name":[{pattern:/(^|[^\w-])(?:iterable|maplike|setlike)\s*<(?:[^<>]|<[^<>]*>)*>/,lookbehind:!0,inside:s},{pattern:RegExp(/(\b(?:attribute|const|deleter|getter|optional|setter)\s+)/.source+r),lookbehind:!0,inside:s},{pattern:RegExp("("+/\bcallback\s+/.source+n+/\s*=\s*/.source+")"+r),lookbehind:!0,inside:s},{pattern:RegExp(/(\btypedef\b\s*)/.source+r),lookbehind:!0,inside:s},{pattern:RegExp(/(\b(?:callback|dictionary|enum|interface(?:\s+mixin)?)\s+)(?!(?:interface|mixin)\b)/.source+n),lookbehind:!0},{pattern:RegExp(/(:\s*)/.source+n),lookbehind:!0},RegExp(n+/(?=\s+(?:implements|includes)\b)/.source),{pattern:RegExp(/(\b(?:implements|includes)\s+)/.source+n),lookbehind:!0},{pattern:RegExp(r+"(?="+/\s*(?:\.{3}\s*)?/.source+n+/\s*[(),;=]/.source+")"),inside:s}],builtin:/\b(?:ArrayBuffer|BigInt64Array|BigUint64Array|ByteString|DOMString|DataView|Float32Array|Float64Array|FrozenArray|Int16Array|Int32Array|Int8Array|ObservableArray|Promise|USVString|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray)\b/,keyword:[/\b(?:async|attribute|callback|const|constructor|deleter|dictionary|enum|getter|implements|includes|inherit|interface|mixin|namespace|null|optional|or|partial|readonly|required|setter|static|stringifier|typedef|unrestricted)\b/,/\b(?:any|bigint|boolean|byte|double|float|iterable|long|maplike|object|octet|record|sequence|setlike|short|symbol|undefined|unsigned|void)\b/],boolean:/\b(?:false|true)\b/,number:{pattern:/(^|[^\w-])-?(?:0x[0-9a-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|NaN|Infinity)(?![\w-])/i,lookbehind:!0},operator:/\.{3}|[=:?<>-]/,punctuation:/[(){}[\].,;]/};for(var i in t.languages["web-idl"])i!=="class-name"&&(s[i]=t.languages["web-idl"][i]);t.languages.webidl=t.languages["web-idl"]})(e)}Jg.displayName="wgsl";Jg.aliases=[];function Jg(e){e.languages.wgsl={comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},"builtin-attribute":{pattern:/(@)builtin\(.*?\)/,lookbehind:!0,inside:{attribute:{pattern:/^builtin/,alias:"attr-name"},punctuation:/[(),]/,"built-in-values":{pattern:/\b(?:frag_depth|front_facing|global_invocation_id|instance_index|local_invocation_id|local_invocation_index|num_workgroups|position|sample_index|sample_mask|vertex_index|workgroup_id)\b/,alias:"attr-value"}}},attributes:{pattern:/(@)(?:align|binding|compute|const|fragment|group|id|interpolate|invariant|location|size|vertex|workgroup_size)/i,lookbehind:!0,alias:"attr-name"},functions:{pattern:/\b(fn\s+)[_a-zA-Z]\w*(?=[(<])/,lookbehind:!0,alias:"function"},keyword:/\b(?:bitcast|break|case|const|continue|continuing|default|discard|else|enable|fallthrough|fn|for|function|if|let|loop|private|return|storage|struct|switch|type|uniform|var|while|workgroup)\b/,builtin:/\b(?:abs|acos|acosh|all|any|array|asin|asinh|atan|atan2|atanh|atomic|atomicAdd|atomicAnd|atomicCompareExchangeWeak|atomicExchange|atomicLoad|atomicMax|atomicMin|atomicOr|atomicStore|atomicSub|atomicXor|bool|ceil|clamp|cos|cosh|countLeadingZeros|countOneBits|countTrailingZeros|cross|degrees|determinant|distance|dot|dpdx|dpdxCoarse|dpdxFine|dpdy|dpdyCoarse|dpdyFine|exp|exp2|extractBits|f32|f64|faceForward|firstLeadingBit|floor|fma|fract|frexp|fwidth|fwidthCoarse|fwidthFine|i32|i64|insertBits|inverseSqrt|ldexp|length|log|log2|mat[2-4]x[2-4]|max|min|mix|modf|normalize|override|pack2x16float|pack2x16snorm|pack2x16unorm|pack4x8snorm|pack4x8unorm|pow|ptr|quantizeToF16|radians|reflect|refract|reverseBits|round|sampler|sampler_comparison|select|shiftLeft|shiftRight|sign|sin|sinh|smoothstep|sqrt|staticAssert|step|storageBarrier|tan|tanh|textureDimensions|textureGather|textureGatherCompare|textureLoad|textureNumLayers|textureNumLevels|textureNumSamples|textureSample|textureSampleBias|textureSampleCompare|textureSampleCompareLevel|textureSampleGrad|textureSampleLevel|textureStore|texture_1d|texture_2d|texture_2d_array|texture_3d|texture_cube|texture_cube_array|texture_depth_2d|texture_depth_2d_array|texture_depth_cube|texture_depth_cube_array|texture_depth_multisampled_2d|texture_multisampled_2d|texture_storage_1d|texture_storage_2d|texture_storage_2d_array|texture_storage_3d|transpose|trunc|u32|u64|unpack2x16float|unpack2x16snorm|unpack2x16unorm|unpack4x8snorm|unpack4x8unorm|vec[2-4]|workgroupBarrier)\b/,"function-calls":{pattern:/\b[_a-z]\w*(?=\()/i,alias:"function"},"class-name":/\b(?:[A-Z][A-Za-z0-9]*)\b/,"bool-literal":{pattern:/\b(?:false|true)\b/,alias:"boolean"},"hex-int-literal":{pattern:/\b0[xX][0-9a-fA-F]+[iu]?\b(?![.pP])/,alias:"number"},"hex-float-literal":{pattern:/\b0[xX][0-9a-fA-F]*(?:\.[0-9a-fA-F]*)?(?:[pP][+-]?\d+[fh]?)?/,alias:"number"},"decimal-float-literal":[{pattern:/\d*\.\d+(?:[eE](?:\+|-)?\d+)?[fh]?/,alias:"number"},{pattern:/\d+\.\d*(?:[eE](?:\+|-)?\d+)?[fh]?/,alias:"number"},{pattern:/\d+[eE](?:\+|-)?\d+[fh]?/,alias:"number"},{pattern:/\b\d+[fh]\b/,alias:"number"}],"int-literal":{pattern:/\b\d+[iu]?\b/,alias:"number"},operator:[{pattern:/(?:\^|~|\|(?!\|)|\|\||&&|<<|>>|!)(?!=)/},{pattern:/&(?![&=])/},{pattern:/(?:\+=|-=|\*=|\/=|%=|\^=|&=|\|=|<<=|>>=)/},{pattern:/(^|[^<>=!])=(?![=>])/,lookbehind:!0},{pattern:/(?:==|!=|<=|\+\+|--|(^|[^=])>=)/,lookbehind:!0},{pattern:/(?:(?:[+%]|(?:\*(?!\w)))(?!=))|(?:-(?!>))|(?:\/(?!\/))/},{pattern:/->/}],punctuation:/[@(){}[\],;<>:.]/}}eb.displayName="wiki";eb.aliases=[];function eb(e){e.register(rn),e.languages.wiki=e.languages.extend("markup",{"block-comment":{pattern:/(^|[^\\])\/\*[\s\S]*?\*\//,lookbehind:!0,alias:"comment"},heading:{pattern:/^(=+)[^=\r\n].*?\1/m,inside:{punctuation:/^=+|=+$/,important:/.+/}},emphasis:{pattern:/('{2,5}).+?\1/,inside:{"bold-italic":{pattern:/(''''').+?(?=\1)/,lookbehind:!0,alias:["bold","italic"]},bold:{pattern:/(''')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},italic:{pattern:/('')[^'](?:.*?[^'])?(?=\1)/,lookbehind:!0},punctuation:/^''+|''+$/}},hr:{pattern:/^-{4,}/m,alias:"punctuation"},url:[/ISBN +(?:97[89][ -]?)?(?:\d[ -]?){9}[\dx]\b|(?:PMID|RFC) +\d+/i,/\[\[.+?\]\]|\[.+?\]/],variable:[/__[A-Z]+__/,/\{{3}.+?\}{3}/,/\{\{.+?\}\}/],symbol:[/^#redirect/im,/~{3,5}/],"table-tag":{pattern:/((?:^|[|!])[|!])[^|\r\n]+\|(?!\|)/m,lookbehind:!0,inside:{"table-bar":{pattern:/\|$/,alias:"punctuation"},rest:e.languages.markup.tag.inside}},punctuation:/^(?:\{\||\|\}|\|-|[*#:;!|])|\|\||!!/m}),e.languages.insertBefore("wiki","tag",{nowiki:{pattern:/<(nowiki|pre|source)\b[^>]*>[\s\S]*?<\/\1>/i,inside:{tag:{pattern:/<(?:nowiki|pre|source)\b[^>]*>|<\/(?:nowiki|pre|source)>/i,inside:e.languages.markup.tag.inside}}}})}tb.displayName="wolfram";tb.aliases=["mathematica","nb","wl"];function tb(e){e.languages.wolfram={comment:/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,string:{pattern:/"(?:\\.|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:Abs|AbsArg|Accuracy|Block|Do|For|Function|If|Manipulate|Module|Nest|NestList|None|Return|Switch|Table|Which|While)\b/,context:{pattern:/\b\w+`+\w*/,alias:"class-name"},blank:{pattern:/\b\w+_\b/,alias:"regex"},"global-variable":{pattern:/\$\w+/,alias:"variable"},boolean:/\b(?:False|True)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/\/\.|;|=\.|\^=|\^:=|:=|<<|>>|<\||\|>|:>|\|->|->|<-|@@@|@@|@|\/@|=!=|===|==|=|\+|-|\[\/-+%=\]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},e.languages.mathematica=e.languages.wolfram,e.languages.wl=e.languages.wolfram,e.languages.nb=e.languages.wolfram}nb.displayName="wren";nb.aliases=[];function nb(e){e.languages.wren={comment:[{pattern:/\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*)|\/\*(?:[^*/]|\*(?!\/)|\/(?!\*))*\*\/)*\*\/)*\*\//,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],"triple-quoted-string":{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string"},"string-literal":null,hashbang:{pattern:/^#!\/.+/,greedy:!0,alias:"comment"},attribute:{pattern:/#!?[ \t\u3000]*\w+/,alias:"keyword"},"class-name":[{pattern:/(\bclass\s+)\w+/,lookbehind:!0},/\b[A-Z][a-z\d_]*\b/],constant:/\b[A-Z][A-Z\d_]*\b/,null:{pattern:/\bnull\b/,alias:"keyword"},keyword:/\b(?:as|break|class|construct|continue|else|for|foreign|if|import|in|is|return|static|super|this|var|while)\b/,boolean:/\b(?:false|true)\b/,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,function:/\b[a-z_]\w*(?=\s*[({])/i,operator:/<<|>>|[=!<>]=?|&&|\|\||[-+*/%~^&|?:]|\.{2,3}/,punctuation:/[\[\](){}.,;]/},e.languages.wren["string-literal"]={pattern:/(^|[^\\"])"(?:[^\\"%]|\\[\s\S]|%(?!\()|%\((?:[^()]|\((?:[^()]|\([^)]*\))*\))*\))*"/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)%\((?:[^()]|\((?:[^()]|\([^)]*\))*\))*\)/,lookbehind:!0,inside:{expression:{pattern:/^(%\()[\s\S]+(?=\)$)/,lookbehind:!0,inside:e.languages.wren},"interpolation-punctuation":{pattern:/^%\(|\)$/,alias:"punctuation"}}},string:/[\s\S]+/}}}rb.displayName="xeora";rb.aliases=["xeoracube"];function rb(e){e.register(rn),(function(t){t.languages.xeora=t.languages.extend("markup",{constant:{pattern:/\$(?:DomainContents|PageRenderDuration)\$/,inside:{punctuation:{pattern:/\$/}}},variable:{pattern:/\$@?(?:#+|[-+*~=^])?[\w.]+\$/,inside:{punctuation:{pattern:/[$.]/},operator:{pattern:/#+|[-+*~=^@]/}}},"function-inline":{pattern:/\$F:[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\$/,inside:{variable:{pattern:/(?:[,|])@?(?:#+|[-+*~=^])?[\w.]+/,inside:{punctuation:{pattern:/[,.|]/},operator:{pattern:/#+|[-+*~=^@]/}}},punctuation:{pattern:/\$\w:|[$:?.,|]/}},alias:"function"},"function-block":{pattern:/\$XF:\{[-\w.]+\?[-\w.]+(?:,(?:(?:@[-#]*\w+\.[\w+.]\.*)*\|)*(?:(?:[\w+]|[-#*.~^]+[\w+]|=\S)(?:[^$=]|=+[^=])*=*|(?:@[-#]*\w+\.[\w+.]\.*)+(?:(?:[\w+]|[-#*~^][-#*.~^]*[\w+]|=\S)(?:[^$=]|=+[^=])*=*)?)?)?\}:XF\$/,inside:{punctuation:{pattern:/[$:{}?.,|]/}},alias:"function"},"directive-inline":{pattern:/\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\/\w.]+\$/,inside:{punctuation:{pattern:/\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,inside:{tag:{pattern:/#\d/}}}},alias:"function"},"directive-block-open":{pattern:/\$\w+:\{|\$\w(?:#\d+\+?)?(?:\[[-\w.]+\])?:[-\w.]+:\{(?:![A-Z]+)?/,inside:{punctuation:{pattern:/\$(?:\w:|C(?:\[|#\d))?|[:{[\]]/,inside:{tag:{pattern:/#\d/}}},attribute:{pattern:/![A-Z]+$/,inside:{punctuation:{pattern:/!/}},alias:"keyword"}},alias:"function"},"directive-block-separator":{pattern:/\}:[-\w.]+:\{/,inside:{punctuation:{pattern:/[:{}]/}},alias:"function"},"directive-block-close":{pattern:/\}:[-\w.]+\$/,inside:{punctuation:{pattern:/[:{}$]/}},alias:"function"}}),t.languages.insertBefore("inside","punctuation",{variable:t.languages.xeora["function-inline"].inside.variable},t.languages.xeora["function-block"]),t.languages.xeoracube=t.languages.xeora})(e)}sb.displayName="xml-doc";sb.aliases=[];function sb(e){e.register(rn),(function(t){function n(o,l){t.languages[o]&&t.languages.insertBefore(o,"comment",{"doc-comment":l})}var r=t.languages.markup.tag,s={pattern:/\/\/\/.*/,greedy:!0,alias:"comment",inside:{tag:r}},i={pattern:/'''.*/,greedy:!0,alias:"comment",inside:{tag:r}};n("csharp",s),n("fsharp",s),n("vbnet",i)})(e)}ab.displayName="xojo";ab.aliases=[];function ab(e){e.languages.xojo={comment:{pattern:/(?:'|\/\/|Rem\b).+/i,greedy:!0},string:{pattern:/"(?:""|[^"])*"/,greedy:!0},number:[/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,/&[bchou][a-z\d]+/i],directive:{pattern:/#(?:Else|ElseIf|Endif|If|Pragma)\b/i,alias:"property"},keyword:/\b(?:AddHandler|App|Array|As(?:signs)?|Auto|Boolean|Break|By(?:Ref|Val)|Byte|Call|Case|Catch|CFStringRef|CGFloat|Class|Color|Const|Continue|CString|Currency|CurrentMethodName|Declare|Delegate|Dim|Do(?:uble|wnTo)?|Each|Else(?:If)?|End|Enumeration|Event|Exception|Exit|Extends|False|Finally|For|Function|Get|GetTypeInfo|Global|GOTO|If|Implements|In|Inherits|Int(?:8|16|32|64|eger|erface)?|Lib|Loop|Me|Module|Next|Nil|Object|Optional|OSType|ParamArray|Private|Property|Protected|PString|Ptr|Raise(?:Event)?|ReDim|RemoveHandler|Return|Select(?:or)?|Self|Set|Shared|Short|Single|Soft|Static|Step|String|Sub|Super|Text|Then|To|True|Try|Ubound|UInt(?:8|16|32|64|eger)?|Until|Using|Var(?:iant)?|Wend|While|WindowPtr|WString)\b/i,operator:/<[=>]?|>=?|[+\-*\/\\^=]|\b(?:AddressOf|And|Ctype|IsA?|Mod|New|Not|Or|WeakAddressOf|Xor)\b/i,punctuation:/[.,;:()]/}}ib.displayName="xquery";ib.aliases=[];function ib(e){e.register(rn),(function(t){t.languages.xquery=t.languages.extend("markup",{"xquery-comment":{pattern:/\(:[\s\S]*?:\)/,greedy:!0,alias:"comment"},string:{pattern:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,greedy:!0},extension:{pattern:/\(#.+?#\)/,alias:"symbol"},variable:/\$[-\w:]+/,axis:{pattern:/(^|[^-])(?:ancestor(?:-or-self)?|attribute|child|descendant(?:-or-self)?|following(?:-sibling)?|parent|preceding(?:-sibling)?|self)(?=::)/,lookbehind:!0,alias:"operator"},"keyword-operator":{pattern:/(^|[^:-])\b(?:and|castable as|div|eq|except|ge|gt|idiv|instance of|intersect|is|le|lt|mod|ne|or|union)\b(?=$|[^:-])/,lookbehind:!0,alias:"operator"},keyword:{pattern:/(^|[^:-])\b(?:as|ascending|at|base-uri|boundary-space|case|cast as|collation|construction|copy-namespaces|declare|default|descending|else|empty (?:greatest|least)|encoding|every|external|for|function|if|import|in|inherit|lax|let|map|module|namespace|no-inherit|no-preserve|option|order(?: by|ed|ing)?|preserve|return|satisfies|schema|some|stable|strict|strip|then|to|treat as|typeswitch|unordered|validate|variable|version|where|xquery)\b(?=$|[^:-])/,lookbehind:!0},function:/[\w-]+(?::[\w-]+)*(?=\s*\()/,"xquery-element":{pattern:/(element\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"tag"},"xquery-attribute":{pattern:/(attribute\s+)[\w-]+(?::[\w-]+)*/,lookbehind:!0,alias:"attr-name"},builtin:{pattern:/(^|[^:-])\b(?:attribute|comment|document|element|processing-instruction|text|xs:(?:ENTITIES|ENTITY|ID|IDREFS?|NCName|NMTOKENS?|NOTATION|Name|QName|anyAtomicType|anyType|anyURI|base64Binary|boolean|byte|date|dateTime|dayTimeDuration|decimal|double|duration|float|gDay|gMonth|gMonthDay|gYear|gYearMonth|hexBinary|int|integer|language|long|negativeInteger|nonNegativeInteger|nonPositiveInteger|normalizedString|positiveInteger|short|string|time|token|unsigned(?:Byte|Int|Long|Short)|untyped(?:Atomic)?|yearMonthDuration))\b(?=$|[^:-])/,lookbehind:!0},number:/\b\d+(?:\.\d+)?(?:E[+-]?\d+)?/,operator:[/[+*=?|@]|\.\.?|:=|!=|<[=<]?|>[=>]?/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}],punctuation:/[[\](){},;:/]/}),t.languages.xquery.tag.pattern=/<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/,t.languages.xquery.tag.inside["attr-value"].pattern=/=(?:("|')(?:\\[\s\S]|\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}|(?!\1)[^\\])*\1|[^\s'">=]+)/,t.languages.xquery.tag.inside["attr-value"].inside.punctuation=/^="|"$/,t.languages.xquery.tag.inside["attr-value"].inside.expression={pattern:/\{(?!\{)(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])+\}/,inside:t.languages.xquery,alias:"language-xquery"};var n=function(s){return typeof s=="string"?s:typeof s.content=="string"?s.content:s.content.map(n).join("")},r=function(s){for(var i=[],o=0;o<s.length;o++){var l=s[o],u=!1;if(typeof l!="string"&&(l.type==="tag"&&l.content[0]&&l.content[0].type==="tag"?l.content[0].content[0].content==="</"?i.length>0&&i[i.length-1].tagName===n(l.content[0].content[1])&&i.pop():l.content[l.content.length-1].content==="/>"||i.push({tagName:n(l.content[0].content[1]),openedBraces:0}):i.length>0&&l.type==="punctuation"&&l.content==="{"&&(!s[o+1]||s[o+1].type!=="punctuation"||s[o+1].content!=="{")&&(!s[o-1]||s[o-1].type!=="plain-text"||s[o-1].content!=="{")?i[i.length-1].openedBraces++:i.length>0&&i[i.length-1].openedBraces>0&&l.type==="punctuation"&&l.content==="}"?i[i.length-1].openedBraces--:l.type!=="comment"&&(u=!0)),(u||typeof l=="string")&&i.length>0&&i[i.length-1].openedBraces===0){var c=n(l);o<s.length-1&&(typeof s[o+1]=="string"||s[o+1].type==="plain-text")&&(c+=n(s[o+1]),s.splice(o+1,1)),o>0&&(typeof s[o-1]=="string"||s[o-1].type==="plain-text")&&(c=n(s[o-1])+c,s.splice(o-1,1),o--),/^\s+$/.test(c)?s[o]=c:s[o]=new t.Token("plain-text",c,null,c)}l.content&&typeof l.content!="string"&&r(l.content)}};t.hooks.add("after-tokenize",function(s){s.language==="xquery"&&r(s.tokens)})})(e)}ob.displayName="yang";ob.aliases=[];function ob(e){e.languages.yang={comment:/\/\*[\s\S]*?\*\/|\/\/.*/,string:{pattern:/"(?:[^\\"]|\\.)*"|'[^']*'/,greedy:!0},keyword:{pattern:/(^|[{};\r\n][ \t]*)[a-z_][\w.-]*/i,lookbehind:!0},namespace:{pattern:/(\s)[a-z_][\w.-]*(?=:)/i,lookbehind:!0},boolean:/\b(?:false|true)\b/,operator:/\+/,punctuation:/[{};:]/}}lb.displayName="zig";lb.aliases=[];function lb(e){(function(t){function n(c){return function(){return c}}var r=/\b(?:align|allowzero|and|anyframe|anytype|asm|async|await|break|cancel|catch|comptime|const|continue|defer|else|enum|errdefer|error|export|extern|fn|for|if|inline|linksection|nakedcc|noalias|nosuspend|null|or|orelse|packed|promise|pub|resume|return|stdcallcc|struct|suspend|switch|test|threadlocal|try|undefined|union|unreachable|usingnamespace|var|volatile|while)\b/,s="\\b(?!"+r.source+")(?!\\d)\\w+\\b",i=/align\s*\((?:[^()]|\([^()]*\))*\)/.source,o=/(?:\?|\bpromise->|(?:\[[^[\]]*\]|\*(?!\*)|\*\*)(?:\s*<ALIGN>|\s*const\b|\s*volatile\b|\s*allowzero\b)*)/.source.replace(/<ALIGN>/g,n(i)),l=/(?:\bpromise\b|(?:\berror\.)?<ID>(?:\.<ID>)*(?!\s+<ID>))/.source.replace(/<ID>/g,n(s)),u="(?!\\s)(?:!?\\s*(?:"+o+"\\s*)*"+l+")+";t.languages.zig={comment:[{pattern:/\/\/[/!].*/,alias:"doc-comment"},/\/{2}.*/],string:[{pattern:/(^|[^\\@])c?"(?:[^"\\\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},{pattern:/([\r\n])([ \t]+c?\\{2}).*(?:(?:\r\n?|\n)\2.*)*/,lookbehind:!0,greedy:!0}],char:{pattern:/(^|[^\\])'(?:[^'\\\r\n]|[\uD800-\uDFFF]{2}|\\(?:.|x[a-fA-F\d]{2}|u\{[a-fA-F\d]{1,6}\}))'/,lookbehind:!0,greedy:!0},builtin:/\B@(?!\d)\w+(?=\s*\()/,label:{pattern:/(\b(?:break|continue)\s*:\s*)\w+\b|\b(?!\d)\w+\b(?=\s*:\s*(?:\{|while\b))/,lookbehind:!0},"class-name":[/\b(?!\d)\w+(?=\s*=\s*(?:(?:extern|packed)\s+)?(?:enum|struct|union)\s*[({])/,{pattern:RegExp(/(:\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?[=;,)])|<TYPE>(?=\s*(?:<ALIGN>\s*)?\{)/.source.replace(/<TYPE>/g,n(u)).replace(/<ALIGN>/g,n(i))),lookbehind:!0,inside:null},{pattern:RegExp(/(\)\s*)<TYPE>(?=\s*(?:<ALIGN>\s*)?;)/.source.replace(/<TYPE>/g,n(u)).replace(/<ALIGN>/g,n(i))),lookbehind:!0,inside:null}],"builtin-type":{pattern:/\b(?:anyerror|bool|c_u?(?:int|long|longlong|short)|c_longdouble|c_void|comptime_(?:float|int)|f(?:16|32|64|128)|[iu](?:8|16|32|64|128|size)|noreturn|type|void)\b/,alias:"keyword"},keyword:r,function:/\b(?!\d)\w+(?=\s*\()/,number:/\b(?:0b[01]+|0o[0-7]+|0x[a-fA-F\d]+(?:\.[a-fA-F\d]*)?(?:[pP][+-]?[a-fA-F\d]+)?|\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)\b/,boolean:/\b(?:false|true)\b/,operator:/\.[*?]|\.{2,3}|[-=]>|\*\*|\+\+|\|\||(?:<<|>>|[-+*]%|[-+*/%^&|<>!=])=?|[?~]/,punctuation:/[.:,;(){}[\]]/},t.languages.zig["class-name"].forEach(function(c){c.inside===null&&(c.inside=t.languages.zig)})})(e)}_.register(rn);_.register(Hr);_.register(rt);_.register(ru);_.register(cn);_.register(wp);_.register(vp);_.register(Ap);_.register(kp);_.register(_p);_.register(Cp);_.register(Ip);_.register(Rp);_.register(fa);_.register(Dp);_.register(Op);_.register(Lp);_.register(jp);_.register(Yn);_.register(ps);_.register(Jl);_.register(Mp);_.register(Fp);_.register($i);_.register(Hi);_.register(ou);_.register(Pp);_.register(Bp);_.register(fs);_.register(Up);_.register($p);_.register(zp);_.register(Hp);_.register(Gp);_.register(Wp);_.register(qp);_.register(Vp);_.register(Wi);_.register(Yp);_.register(Kp);_.register(Zp);_.register(Xp);_.register(Qp);_.register(Jp);_.register(ef);_.register(tf);_.register(nf);_.register(rf);_.register(sf);_.register(af);_.register(of);_.register(lf);_.register(uf);_.register(cf);_.register(df);_.register(pf);_.register(ff);_.register(mf);_.register(hf);_.register(gf);_.register(bf);_.register(xf);_.register(yf);_.register(gs);_.register(Ef);_.register(Sf);_.register(Tf);_.register(Nf);_.register(wf);_.register(vf);_.register(Af);_.register(kf);_.register(_f);_.register(Cf);_.register(eu);_.register(dn);_.register(If);_.register(Rf);_.register(Df);_.register(Of);_.register(Lf);_.register(jf);_.register(Mf);_.register(Ff);_.register(Pf);_.register(Bf);_.register(zi);_.register(Uf);_.register($f);_.register(zf);_.register(Hf);_.register(Gf);_.register(Wf);_.register(qf);_.register(Vf);_.register(Yf);_.register(Kf);_.register(Zf);_.register(Xf);_.register(Qf);_.register(Jf);_.register(em);_.register(tm);_.register(nm);_.register(rm);_.register(sm);_.register(am);_.register(im);_.register(om);_.register(tu);_.register(lm);_.register(um);_.register(cm);_.register(dm);_.register(au);_.register(fu);_.register(pm);_.register(fm);_.register(mm);_.register(Yi);_.register(hm);_.register(gm);_.register(bm);_.register(xm);_.register(ym);_.register(Em);_.register(pa);_.register(Sm);_.register(Tm);_.register(Nm);_.register(wm);_.register(vm);_.register(Am);_.register(km);_.register(_m);_.register(nu);_.register(Cm);_.register(Im);_.register(ms);_.register(hs);_.register(ba);_.register(Rm);_.register(Dm);_.register(Om);_.register(Lm);_.register(jm);_.register(Mm);_.register(Fm);_.register(ma);_.register(Pm);_.register(Bm);_.register(Um);_.register($m);_.register(zm);_.register(Hm);_.register(Gm);_.register(Wm);_.register(qm);_.register(su);_.register(Vm);_.register(Ym);_.register(Km);_.register(Zm);_.register(Ki);_.register(Xm);_.register(Qm);_.register(Jm);_.register(eh);_.register(th);_.register(nh);_.register(rh);_.register(sh);_.register(iu);_.register(bu);_.register(ah);_.register(ih);_.register(oh);_.register(lh);_.register(uh);_.register(ch);_.register(dh);_.register(ph);_.register(fh);_.register(mh);_.register(hh);_.register(gh);_.register(bh);_.register(xh);_.register(yh);_.register(Eh);_.register(Sh);_.register(Th);_.register(Nh);_.register(lu);_.register(wh);_.register(vh);_.register(Ah);_.register(kh);_.register(_h);_.register(Ch);_.register(Ih);_.register(Rh);_.register(Dh);_.register(Oh);_.register(Lh);_.register(jh);_.register(uu);_.register(Mh);_.register(Fh);_.register(Ph);_.register(Bh);_.register(Uh);_.register($h);_.register(zh);_.register(Hh);_.register(Gh);_.register(Wh);_.register(qh);_.register(Vh);_.register(Yh);_.register(Kh);_.register(Zh);_.register(Xh);_.register(Qh);_.register(Jh);_.register(Gi);_.register(eg);_.register(tg);_.register(ng);_.register(rg);_.register(cu);_.register(sg);_.register(ag);_.register(xu);_.register(ig);_.register(og);_.register(lg);_.register(ug);_.register(cg);_.register(dg);_.register(pg);_.register(fg);_.register(mg);_.register(du);_.register(hg);_.register(pu);_.register(gg);_.register(bg);_.register(xg);_.register(yg);_.register(Eg);_.register(Sg);_.register(Tg);_.register(Ng);_.register(yu);_.register(wg);_.register(vg);_.register(Ag);_.register(kg);_.register(_g);_.register(Cg);_.register(Ig);_.register(Rg);_.register(mu);_.register(Dg);_.register(Zi);_.register(Og);_.register(qi);_.register(Lg);_.register(jg);_.register(Mg);_.register(Fg);_.register(Pg);_.register(Bg);_.register(Ug);_.register($g);_.register(zg);_.register(Hg);_.register(Gg);_.register(Wg);_.register(qg);_.register(Vg);_.register(Yg);_.register(Kg);_.register(Zg);_.register(Xg);_.register(Qg);_.register(Jg);_.register(eb);_.register(tb);_.register(nb);_.register(rb);_.register(sb);_.register(ab);_.register(ib);_.register(ob);_.register(lb);function Sd(){Sd=function(s,i){return new n(s,void 0,i)};var e=RegExp.prototype,t=new WeakMap;function n(s,i,o){var l=new RegExp(s,i);return t.set(l,o||t.get(s)),gl(l,n.prototype)}function r(s,i){var o=t.get(i);return Object.keys(o).reduce(function(l,u){var c=o[u];if(typeof c=="number")l[u]=s[c];else{for(var d=0;s[c[d]]===void 0&&d+1<c.length;)d++;l[u]=s[c[d]]}return l},Object.create(null))}return(function(s,i){if(typeof i!="function"&&i!==null)throw new TypeError("Super expression must either be null or a function");s.prototype=Object.create(i&&i.prototype,{constructor:{value:s,writable:!0,configurable:!0}}),Object.defineProperty(s,"prototype",{writable:!1}),i&&gl(s,i)})(n,RegExp),n.prototype.exec=function(s){var i=e.exec.call(this,s);if(i){i.groups=r(i,this);var o=i.indices;o&&(o.groups=r(o,this))}return i},n.prototype[Symbol.replace]=function(s,i){if(typeof i=="string"){var o=t.get(this);return e[Symbol.replace].call(this,s,i.replace(/\$<([^>]+)>/g,function(u,c){var d=o[c];return"$"+(Array.isArray(d)?d.join("$"):d)}))}if(typeof i=="function"){var l=this;return e[Symbol.replace].call(this,s,function(){var u=arguments;return typeof u[u.length-1]!="object"&&(u=[].slice.call(u)).push(r(u,l)),i.apply(this,u)})}return e[Symbol.replace].call(this,s,i)},Sd.apply(this,arguments)}function gl(e,t){return gl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},gl(e,t)}function w0(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tc(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=(function(s,i){if(s){if(typeof s=="string")return w0(s,i);var o=Object.prototype.toString.call(s).slice(8,-1);return o==="Object"&&s.constructor&&(o=s.constructor.name),o==="Map"||o==="Set"?Array.from(s):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?w0(s,i):void 0}})(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
@@ -296,7 +296,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
296
296
|
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
297
297
|
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=Po(t),r=ks(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=Po(t),r=ks(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Qz(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Zz||null,prettyErrors:t}}function Jz(e,t={}){const{lineCounter:n,prettyErrors:r}=Qz(t),s=new Xz(n?.addNewLine),i=new Wz(t);let o=null;for(const l of i.compose(s.parse(e),!0,e.length))if(!o)o=l;else if(o.options.logLevel!=="silent"){o.errors.push(new Za(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(o.errors.forEach(aE(e,n)),o.warnings.forEach(aE(e,n))),o}function eH(e,t,n){let r;const s=Jz(e,n);if(!s)return null;if(s.warnings.forEach(i=>yw(s.options.logLevel,i)),s.errors.length>0){if(s.options.logLevel!=="silent")throw s.errors[0];s.errors=[]}return s.toJS(Object.assign({reviver:r},n))}const Yw=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;function Qb(e){if(!e)return"";const t=e.charCodeAt(0)===65279?e.slice(1):e,n=t.match(Yw);return n?t.slice(n[0].length):t}function tH(e){if(!e)return{frontmatterRaw:null,body:""};const t=e.charCodeAt(0)===65279?e.slice(1):e,n=t.match(Yw);return n?{frontmatterRaw:n[1]?.trim()??"",body:t.slice(n[0].length)}:{frontmatterRaw:null,body:t}}function Kw(e){const{frontmatterRaw:t,body:n}=tH(e);if(!t)return{frontmatterRaw:null,frontmatter:null,body:n};let r=null;try{const s=eH(t);s&&typeof s=="object"&&!Array.isArray(s)&&(r=s)}catch{r=null}return{frontmatterRaw:t,frontmatter:r,body:n}}function nH({files:e,selectedPath:t,onSelect:n}){const[r,s]=g.useState(""),i=g.useMemo(()=>{if(!r.trim())return e;const u=r.toLowerCase();return e.filter(c=>c.name.toLowerCase().includes(u)||c.title.toLowerCase().includes(u)||c.path.toLowerCase().includes(u))},[e,r]),o=g.useMemo(()=>i.filter(u=>u.category==="root"||u.category==="architecture"),[i]),l=g.useMemo(()=>i.filter(u=>u.category==="satellite"),[i]);return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden","data-testid":"design-file-list",children:[a.jsx("div",{className:"p-2 border-b border-spur-border bg-base-100/50 shrink-0",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:r,onChange:u=>s(u.target.value),placeholder:"Filter design docs...",className:"w-full text-xs px-2.5 py-1.5 pl-7 rounded border border-spur-border bg-base-100 text-spur-text placeholder:text-spur-text-muted/60 focus:outline-none focus:border-spur-accent","aria-label":"Filter design documents"}),a.jsx("span",{className:"absolute left-2 top-1.5 text-xs text-spur-text-muted pointer-events-none",children:"🔍"}),r&&a.jsx("button",{type:"button",onClick:()=>s(""),className:"absolute right-2 top-1 text-xs text-spur-text-muted hover:text-spur-text p-0.5","aria-label":"Clear filter",children:"✕"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-3",children:i.length===0?a.jsx("div",{className:"p-4 text-xs text-spur-text-muted italic text-center",children:r?`No documents match "${r}"`:"No design documents found."}):a.jsxs(a.Fragment,{children:[o.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] font-bold uppercase tracking-wider text-spur-text-muted flex items-center justify-between",children:[a.jsx("span",{children:"Core Specifications"}),a.jsx("span",{className:"text-[10px] font-mono",children:o.length})]}),a.jsx("div",{className:"space-y-0.5 mt-1",children:o.map(u=>{const c=t===u.path;return a.jsxs("button",{type:"button",onClick:()=>n(u.path),title:u.name,className:`w-full text-left px-2.5 py-1.5 rounded-md transition-colors flex items-center gap-2 cursor-pointer ${c?"bg-spur-accent/15 text-spur-accent font-semibold shadow-xs":"hover:bg-base-300 text-spur-text hover:text-spur-text"}`,children:[a.jsx("span",{className:"text-sm shrink-0",children:u.name==="DESIGN.md"?"🎨":"📐"}),a.jsx("span",{className:"flex-1 min-w-0 text-xs truncate font-medium",title:u.name,children:u.title})]},u.id)})})]}),l.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] font-bold uppercase tracking-wider text-spur-text-muted flex items-center justify-between",children:[a.jsx("span",{children:"Design Satellites"}),a.jsx("span",{className:"text-[10px] font-mono",children:l.length})]}),a.jsx("div",{className:"space-y-0.5 mt-1",children:l.map(u=>{const c=t===u.path;return a.jsxs("button",{type:"button",onClick:()=>n(u.path),title:u.name,className:`w-full text-left px-2.5 py-1.5 rounded-md transition-colors flex items-center gap-2 cursor-pointer ${c?"bg-spur-accent/15 text-spur-accent font-semibold shadow-xs":"hover:bg-base-300 text-spur-text hover:text-spur-text"}`,children:[a.jsx("span",{className:"text-xs shrink-0 text-spur-text-muted",children:"📄"}),a.jsx("span",{className:"flex-1 min-w-0 text-xs truncate",title:u.name,children:u.title})]},u.id)})})]})]})})]})}const rH=(function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"})(),sH=function(e){return"/"+e},dE={},Zw=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let u=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),l=o?.nonce||o?.getAttribute("nonce");s=u(n.map(c=>{if(c=sH(c),c in dE)return;dE[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const f=document.createElement("link");if(f.rel=d?"stylesheet":rH,d||(f.as="script"),f.crossOrigin="",f.href=c,l&&f.setAttribute("nonce",l),document.head.appendChild(f),d)return new Promise((m,b)=>{f.addEventListener("load",m),f.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};function pE(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function aH(e){if(Array.isArray(e))return e}function iH(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,i,o,l=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,t!==0)for(;!(u=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(d){c=!0,s=d}finally{try{if(!u&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw s}}return l}}function oH(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
298
298
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lH(e,t){return aH(e)||iH(e,t)||uH(e,t)||oH()}function uH(e,t){if(e){if(typeof e=="string")return pE(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pE(e,t):void 0}}const Xw=Object.entries,fE=Object.setPrototypeOf,cH=Object.isFrozen,dH=Object.getPrototypeOf,pH=Object.getOwnPropertyDescriptor;let an=Object.freeze,un=Object.seal,Ls=Object.create,Qw=typeof Reflect<"u"&&Reflect,Gd=Qw.apply,Wd=Qw.construct;an||(an=function(t){return t});un||(un=function(t){return t});Gd||(Gd=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),i=2;i<r;i++)s[i-2]=arguments[i];return t.apply(n,s)});Wd||(Wd=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new t(...r)});const za=Vt(Array.prototype.forEach),fH=Vt(Array.prototype.lastIndexOf),mE=Vt(Array.prototype.pop),_s=Vt(Array.prototype.push),mH=Vt(Array.prototype.splice),Dr=Array.isArray,Xa=Vt(String.prototype.toLowerCase),jc=Vt(String.prototype.toString),hE=Vt(String.prototype.match),Ha=Vt(String.prototype.replace),gE=Vt(String.prototype.indexOf),hH=Vt(String.prototype.trim),gH=Vt(Number.prototype.toString),bH=Vt(Boolean.prototype.toString),bE=typeof BigInt>"u"?null:Vt(BigInt.prototype.toString),xE=typeof Symbol>"u"?null:Vt(Symbol.prototype.toString),Jt=Vt(Object.prototype.hasOwnProperty),Ga=Vt(Object.prototype.toString),sn=Vt(RegExp.prototype.test),Vr=xH(TypeError);function Vt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return Gd(e,t,r)}}function xH(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Wd(e,n)}}function it(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Xa;if(fE&&fE(e,null),!Dr(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const i=n(s);i!==s&&(cH(t)||(t[r]=i),s=i)}e[s]=!0}return e}function yH(e){for(let t=0;t<e.length;t++)Jt(e,t)||(e[t]=null);return e}function bn(e){const t=Ls(null);for(const r of Xw(e)){var n=lH(r,2);const s=n[0],i=n[1];Jt(e,s)&&(Dr(i)?t[s]=yH(i):i&&typeof i=="object"&&i.constructor===Object?t[s]=bn(i):t[s]=i)}return t}function EH(e){switch(typeof e){case"string":return e;case"number":return gH(e);case"boolean":return bH(e);case"bigint":return bE?bE(e):"0";case"symbol":return xE?xE(e):"Symbol()";case"undefined":return Ga(e);case"function":case"object":{if(e===null)return Ga(e);const t=e,n=rr(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Ga(r)}return Ga(e)}default:return Ga(e)}}function rr(e,t){for(;e!==null;){const r=pH(e,t);if(r){if(r.get)return Vt(r.get);if(typeof r.value=="function")return Vt(r.value)}e=dH(e)}function n(){return null}return n}function SH(e){try{return sn(e,""),!0}catch{return!1}}const yE=an(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Mc=an(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fc=an(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),TH=an(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Pc=an(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),NH=an(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),EE=an(["#text"]),SE=an(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Bc=an(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),TE=an(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Bo=an(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),wH=un(/{{[\w\W]*|^[\w\W]*}}/g),vH=un(/<%[\w\W]*|^[\w\W]*%>/g),AH=un(/\${[\w\W]*/g),kH=un(/^data-[\-\w.\u00B7-\uFFFF]+$/),_H=un(/^aria-[\-\w]+$/),NE=un(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),CH=un(/^(?:\w+script|data):/i),IH=un(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),RH=un(/^html$/i),DH=un(/^[a-z][.\w]*(-[.\w]+)+$/i),wE=un(/<[/\w!]/g),OH=un(/<[/\w]/g),LH=un(/<\/no(script|embed|frames)/i),jH=un(/\/>/i),er={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},MH=function(){return typeof window>"u"?null:window},FH=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const i="dompurify"+(r?"#"+r:"");try{return t.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},vE=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ar=function(t,n,r,s){return Jt(t,n)&&Dr(t[n])?it(s.base?bn(s.base):{},t[n],s.transform):r};function Jw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MH();const t=Te=>Jw(Te);if(t.version="3.4.11",t.removed=[],!e||!e.document||e.document.nodeType!==er.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,s=r.currentScript;e.DocumentFragment;const i=e.HTMLTemplateElement,o=e.Node,l=e.Element,u=e.NodeFilter,c=e.NamedNodeMap;c===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,p=e.trustedTypes,f=l.prototype,m=rr(f,"cloneNode"),b=rr(f,"remove"),x=rr(f,"nextSibling"),y=rr(f,"childNodes"),E=rr(f,"parentNode"),v=rr(f,"shadowRoot"),S=rr(f,"attributes"),A=o&&o.prototype?rr(o.prototype,"nodeType"):null,N=o&&o.prototype?rr(o.prototype,"nodeName"):null;if(typeof i=="function"){const Te=n.createElement("template");Te.content&&Te.content.ownerDocument&&(n=Te.content.ownerDocument)}let T,w="",k,F=!1,C=0;const $=function(){if(C>0)throw Vr('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},z=function(B){$(),C++;try{return T.createHTML(B)}finally{C--}},M=function(B){$(),C++;try{return T.createScriptURL(B)}finally{C--}},G=function(){return F||(k=FH(p,s),F=!0),k},H=n,j=H.implementation,q=H.createNodeIterator,re=H.createDocumentFragment,pe=H.getElementsByTagName,I=r.importNode;let Z=vE();t.isSupported=typeof Xw=="function"&&typeof E=="function"&&j&&j.createHTMLDocument!==void 0;const ie=wH,L=vH,Ee=AH,fe=kH,Y=_H,me=CH,te=IH,O=DH;let he=NE,be=null;const ye=it({},[...yE,...Mc,...Fc,...Pc,...EE]);let we=null;const Pe=it({},[...SE,...Bc,...TE,...Bo]);let ue=Object.seal(Ls(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ye=null,at=null;const Qe=Object.seal(Ls(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let At=!0,ft=!0,dt=!1,Ot=!0,qe=!1,De=!0,Ke=!1,Q=!1,le=null,Ae=null,W=!1,_e=!1,Be=!1,ut=!1,mt=!0,kt=!1;const yt="user-content-";let oe=!0,Ne=!1,je={},Ie=null;const gt=it({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ft=null;const ve=it({},["audio","video","img","source","image","track"]);let He=null;const $e=it({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),bt="http://www.w3.org/1998/Math/MathML",ne="http://www.w3.org/2000/svg",de="http://www.w3.org/1999/xhtml";let st=de,wt=!1,V=null;const Me=it({},[bt,ne,de],jc),Ze=an(["mi","mo","mn","ms","mtext"]);let pt=it({},Ze);const _n=an(["annotation-xml"]);let pr=it({},_n);const Qn=it({},["title","style","font","a","script"]);let zn=null;const Ra=["application/xhtml+xml","text/html"],CA="text/html";let Mt=null,Ts=null;const IA=n.createElement("form"),yx=function(B){return B instanceof RegExp||B instanceof Function},Vu=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ts&&Ts===B)return;(!B||typeof B!="object")&&(B={}),B=bn(B),zn=Ra.indexOf(B.PARSER_MEDIA_TYPE)===-1?CA:B.PARSER_MEDIA_TYPE,Mt=zn==="application/xhtml+xml"?jc:Xa,be=Ar(B,"ALLOWED_TAGS",ye,{transform:Mt}),we=Ar(B,"ALLOWED_ATTR",Pe,{transform:Mt}),V=Ar(B,"ALLOWED_NAMESPACES",Me,{transform:jc}),He=Ar(B,"ADD_URI_SAFE_ATTR",$e,{transform:Mt,base:$e}),Ft=Ar(B,"ADD_DATA_URI_TAGS",ve,{transform:Mt,base:ve}),Ie=Ar(B,"FORBID_CONTENTS",gt,{transform:Mt}),Ye=Ar(B,"FORBID_TAGS",bn({}),{transform:Mt}),at=Ar(B,"FORBID_ATTR",bn({}),{transform:Mt}),je=Jt(B,"USE_PROFILES")?B.USE_PROFILES&&typeof B.USE_PROFILES=="object"?bn(B.USE_PROFILES):B.USE_PROFILES:!1,At=B.ALLOW_ARIA_ATTR!==!1,ft=B.ALLOW_DATA_ATTR!==!1,dt=B.ALLOW_UNKNOWN_PROTOCOLS||!1,Ot=B.ALLOW_SELF_CLOSE_IN_ATTR!==!1,qe=B.SAFE_FOR_TEMPLATES||!1,De=B.SAFE_FOR_XML!==!1,Ke=B.WHOLE_DOCUMENT||!1,_e=B.RETURN_DOM||!1,Be=B.RETURN_DOM_FRAGMENT||!1,ut=B.RETURN_TRUSTED_TYPE||!1,W=B.FORCE_BODY||!1,mt=B.SANITIZE_DOM!==!1,kt=B.SANITIZE_NAMED_PROPS||!1,oe=B.KEEP_CONTENT!==!1,Ne=B.IN_PLACE||!1,he=SH(B.ALLOWED_URI_REGEXP)?B.ALLOWED_URI_REGEXP:NE,st=typeof B.NAMESPACE=="string"?B.NAMESPACE:de,pt=Jt(B,"MATHML_TEXT_INTEGRATION_POINTS")&&B.MATHML_TEXT_INTEGRATION_POINTS&&typeof B.MATHML_TEXT_INTEGRATION_POINTS=="object"?bn(B.MATHML_TEXT_INTEGRATION_POINTS):it({},Ze),pr=Jt(B,"HTML_INTEGRATION_POINTS")&&B.HTML_INTEGRATION_POINTS&&typeof B.HTML_INTEGRATION_POINTS=="object"?bn(B.HTML_INTEGRATION_POINTS):it({},_n);const J=Jt(B,"CUSTOM_ELEMENT_HANDLING")&&B.CUSTOM_ELEMENT_HANDLING&&typeof B.CUSTOM_ELEMENT_HANDLING=="object"?bn(B.CUSTOM_ELEMENT_HANDLING):Ls(null);if(ue=Ls(null),Jt(J,"tagNameCheck")&&yx(J.tagNameCheck)&&(ue.tagNameCheck=J.tagNameCheck),Jt(J,"attributeNameCheck")&&yx(J.attributeNameCheck)&&(ue.attributeNameCheck=J.attributeNameCheck),Jt(J,"allowCustomizedBuiltInElements")&&typeof J.allowCustomizedBuiltInElements=="boolean"&&(ue.allowCustomizedBuiltInElements=J.allowCustomizedBuiltInElements),un(ue),qe&&(ft=!1),Be&&(_e=!0),je&&(be=it({},EE),we=Ls(null),je.html===!0&&(it(be,yE),it(we,SE)),je.svg===!0&&(it(be,Mc),it(we,Bc),it(we,Bo)),je.svgFilters===!0&&(it(be,Fc),it(we,Bc),it(we,Bo)),je.mathMl===!0&&(it(be,Pc),it(we,TE),it(we,Bo))),Qe.tagCheck=null,Qe.attributeCheck=null,Jt(B,"ADD_TAGS")&&(typeof B.ADD_TAGS=="function"?Qe.tagCheck=B.ADD_TAGS:Dr(B.ADD_TAGS)&&(be===ye&&(be=bn(be)),it(be,B.ADD_TAGS,Mt))),Jt(B,"ADD_ATTR")&&(typeof B.ADD_ATTR=="function"?Qe.attributeCheck=B.ADD_ATTR:Dr(B.ADD_ATTR)&&(we===Pe&&(we=bn(we)),it(we,B.ADD_ATTR,Mt))),Jt(B,"ADD_URI_SAFE_ATTR")&&Dr(B.ADD_URI_SAFE_ATTR)&&it(He,B.ADD_URI_SAFE_ATTR,Mt),Jt(B,"FORBID_CONTENTS")&&Dr(B.FORBID_CONTENTS)&&(Ie===gt&&(Ie=bn(Ie)),it(Ie,B.FORBID_CONTENTS,Mt)),Jt(B,"ADD_FORBID_CONTENTS")&&Dr(B.ADD_FORBID_CONTENTS)&&(Ie===gt&&(Ie=bn(Ie)),it(Ie,B.ADD_FORBID_CONTENTS,Mt)),oe&&(be["#text"]=!0),Ke&&it(be,["html","head","body"]),be.table&&(it(be,["tbody"]),delete Ye.tbody),B.TRUSTED_TYPES_POLICY){if(typeof B.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vr('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof B.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vr('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Se=T;T=B.TRUSTED_TYPES_POLICY;try{w=z("")}catch(Re){throw T=Se,Re}}else B.TRUSTED_TYPES_POLICY===null?(T=void 0,w=""):(T===void 0&&(T=G()),T&&typeof w=="string"&&(w=z("")));an&&an(B),Ts=B},Ex=it({},[...Mc,...Fc,...TH]),Sx=it({},[...Pc,...NH]),RA=function(B,J,Se){return J.namespaceURI===de?B==="svg":J.namespaceURI===bt?B==="svg"&&(Se==="annotation-xml"||pt[Se]):!!Ex[B]},DA=function(B,J,Se){return J.namespaceURI===de?B==="math":J.namespaceURI===ne?B==="math"&&pr[Se]:!!Sx[B]},OA=function(B,J,Se){return J.namespaceURI===ne&&!pr[Se]||J.namespaceURI===bt&&!pt[Se]?!1:!Sx[B]&&(Qn[B]||!Ex[B])},LA=function(B){let J=E(B);(!J||!J.tagName)&&(J={namespaceURI:st,tagName:"template"});const Se=Xa(B.tagName),Re=Xa(J.tagName);return V[B.namespaceURI]?B.namespaceURI===ne?RA(Se,J,Re):B.namespaceURI===bt?DA(Se,J,Re):B.namespaceURI===de?OA(Se,J,Re):!!(zn==="application/xhtml+xml"&&V[B.namespaceURI]):!1},wr=function(B){_s(t.removed,{element:B});try{E(B).removeChild(B)}catch{if(b(B),!E(B))throw Vr("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Tx=function(B){const J=y(B);if(J){const Re=[];za(J,Xe=>{_s(Re,Xe)}),za(Re,Xe=>{try{b(Xe)}catch{}})}const Se=S(B);if(Se)for(let Re=Se.length-1;Re>=0;--Re){const Xe=Se[Re],ct=Xe&&Xe.name;if(typeof ct=="string")try{B.removeAttribute(ct)}catch{}}},Wr=function(B,J){try{_s(t.removed,{attribute:J.getAttributeNode(B),from:J})}catch{_s(t.removed,{attribute:null,from:J})}if(J.removeAttribute(B),B==="is")if(_e||Be)try{wr(J)}catch{}else try{J.setAttribute(B,"")}catch{}},jA=function(B){const J=S(B);if(J)for(let Se=J.length-1;Se>=0;--Se){const Re=J[Se],Xe=Re&&Re.name;if(!(typeof Xe!="string"||we[Mt(Xe)]))try{B.removeAttribute(Xe)}catch{}}},MA=function(B){const J=[B];for(;J.length>0;){const Se=J.pop();(A?A(Se):Se.nodeType)===er.element&&jA(Se);const Xe=y(Se);if(Xe)for(let ct=Xe.length-1;ct>=0;--ct)J.push(Xe[ct])}},Nx=function(B){let J=null,Se=null;if(W)B="<remove></remove>"+B;else{const ct=hE(B,/^[\r\n\t ]+/);Se=ct&&ct[0]}zn==="application/xhtml+xml"&&st===de&&(B='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+B+"</body></html>");const Re=T?z(B):B;if(st===de)try{J=new d().parseFromString(Re,zn)}catch{}if(!J||!J.documentElement){J=j.createDocument(st,"template",null);try{J.documentElement.innerHTML=wt?w:Re}catch{}}const Xe=J.body||J.documentElement;return B&&Se&&Xe.insertBefore(n.createTextNode(Se),Xe.childNodes[0]||null),st===de?pe.call(J,Ke?"html":"body")[0]:Ke?J.documentElement:Xe},wx=function(B){return q.call(B.ownerDocument||B,B,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},co=function(B){return B=Ha(B,ie," "),B=Ha(B,L," "),B=Ha(B,Ee," "),B},Yu=function(B){var J;B.normalize();const Se=q.call(B.ownerDocument||B,B,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Re=Se.nextNode();for(;Re;)Re.data=co(Re.data),Re=Se.nextNode();const Xe=(J=B.querySelectorAll)===null||J===void 0?void 0:J.call(B,"template");Xe&&za(Xe,ct=>{Ns(ct.content)&&Yu(ct.content)})},po=function(B){const J=N?N(B):null;return typeof J!="string"||Mt(J)!=="form"?!1:typeof B.nodeName!="string"||typeof B.textContent!="string"||typeof B.removeChild!="function"||B.attributes!==S(B)||typeof B.removeAttribute!="function"||typeof B.setAttribute!="function"||typeof B.namespaceURI!="string"||typeof B.insertBefore!="function"||typeof B.hasChildNodes!="function"||B.nodeType!==A(B)||B.childNodes!==y(B)},Ns=function(B){if(!A||typeof B!="object"||B===null)return!1;try{return A(B)===er.documentFragment}catch{return!1}},Da=function(B){if(!A||typeof B!="object"||B===null)return!1;try{return typeof A(B)=="number"}catch{return!1}};function fr(Te,B,J){Te.length!==0&&za(Te,Se=>{Se.call(t,B,J,Ts)})}const FA=function(B,J){return!!(De&&B.hasChildNodes()&&!Da(B.firstElementChild)&&sn(wE,B.textContent)&&sn(wE,B.innerHTML)||De&&B.namespaceURI===de&&J==="style"&&Da(B.firstElementChild)||B.nodeType===er.processingInstruction||De&&B.nodeType===er.comment&&sn(OH,B.data))},PA=function(B,J){if(!Ye[J]&&kx(J)&&(ue.tagNameCheck instanceof RegExp&&sn(ue.tagNameCheck,J)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(J)))return!1;if(oe&&!Ie[J]){const Se=E(B),Re=y(B);if(Re&&Se){const Xe=Re.length;for(let ct=Xe-1;ct>=0;--ct){const Zt=Ne?Re[ct]:m(Re[ct],!0);Se.insertBefore(Zt,x(B))}}}return wr(B),!0},vx=function(B){if(fr(Z.beforeSanitizeElements,B,null),po(B))return wr(B),!0;const J=Mt(N?N(B):B.nodeName);if(fr(Z.uponSanitizeElement,B,{tagName:J,allowedTags:be}),FA(B,J))return wr(B),!0;if(Ye[J]||!(Qe.tagCheck instanceof Function&&Qe.tagCheck(J))&&!be[J])return PA(B,J);if((A?A(B):B.nodeType)===er.element&&!LA(B)||(J==="noscript"||J==="noembed"||J==="noframes")&&sn(LH,B.innerHTML))return wr(B),!0;if(qe&&B.nodeType===er.text){const Re=co(B.textContent);B.textContent!==Re&&(_s(t.removed,{element:B.cloneNode()}),B.textContent=Re)}return fr(Z.afterSanitizeElements,B,null),!1},Ax=function(B,J,Se){if(at[J]||mt&&(J==="id"||J==="name")&&(Se in n||Se in IA))return!1;const Re=we[J]||Qe.attributeCheck instanceof Function&&Qe.attributeCheck(J,B);if(!(ft&&sn(fe,J))){if(!(At&&sn(Y,J))){if(Re){if(!He[J]){if(!sn(he,Ha(Se,te,""))){if(!((J==="src"||J==="xlink:href"||J==="href")&&B!=="script"&&gE(Se,"data:")===0&&Ft[B])){if(!(dt&&!sn(me,Ha(Se,te,"")))){if(Se)return!1}}}}}else if(!(kx(B)&&(ue.tagNameCheck instanceof RegExp&&sn(ue.tagNameCheck,B)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(B))&&(ue.attributeNameCheck instanceof RegExp&&sn(ue.attributeNameCheck,J)||ue.attributeNameCheck instanceof Function&&ue.attributeNameCheck(J,B))||J==="is"&&ue.allowCustomizedBuiltInElements&&(ue.tagNameCheck instanceof RegExp&&sn(ue.tagNameCheck,Se)||ue.tagNameCheck instanceof Function&&ue.tagNameCheck(Se))))return!1}}return!0},BA=it({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),kx=function(B){return!BA[Xa(B)]&&sn(O,B)},UA=function(B,J,Se,Re){if(T&&typeof p=="object"&&typeof p.getAttributeType=="function"&&!Se)switch(p.getAttributeType(B,J)){case"TrustedHTML":return z(Re);case"TrustedScriptURL":return M(Re)}return Re},$A=function(B,J,Se,Re){try{Se?B.setAttributeNS(Se,J,Re):B.setAttribute(J,Re),po(B)?wr(B):mE(t.removed)}catch{Wr(J,B)}},_x=function(B){fr(Z.beforeSanitizeAttributes,B,null);const J=B.attributes;if(!J||po(B))return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let Re=J.length;const Xe=Mt(B.nodeName);for(;Re--;){const ct=J[Re],Zt=ct.name,Gt=ct.namespaceURI,Dn=ct.value,Hn=Mt(Zt),Zu=Dn;let hn=Zt==="value"?Zu:hH(Zu);if(Se.attrName=Hn,Se.attrValue=hn,Se.keepAttr=!0,Se.forceKeepAttr=void 0,fr(Z.uponSanitizeAttribute,B,Se),hn=Se.attrValue,kt&&(Hn==="id"||Hn==="name")&&gE(hn,yt)!==0&&(Wr(Zt,B),hn=yt+hn),De&&sn(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,hn)){Wr(Zt,B);continue}if(Hn==="attributename"&&hE(hn,"href")){Wr(Zt,B);continue}if(!Se.forceKeepAttr){if(!Se.keepAttr){Wr(Zt,B);continue}if(!Ot&&sn(jH,hn)){Wr(Zt,B);continue}if(qe&&(hn=co(hn)),!Ax(Xe,Hn,hn)){Wr(Zt,B);continue}hn=UA(Xe,Hn,Gt,hn),hn!==Zu&&$A(B,Zt,Gt,hn)}}fr(Z.afterSanitizeAttributes,B,null)},fo=function(B){let J=null;const Se=wx(B);for(fr(Z.beforeSanitizeShadowDOM,B,null);J=Se.nextNode();)if(fr(Z.uponSanitizeShadowNode,J,null),vx(J),_x(J),Ns(J.content)&&fo(J.content),(A?A(J):J.nodeType)===er.element){const Xe=v(J);Ns(Xe)&&(Ku(Xe),fo(Xe))}fr(Z.afterSanitizeShadowDOM,B,null)},Ku=function(B){const J=[{node:B,shadow:null}];for(;J.length>0;){const Se=J.pop();if(Se.shadow){fo(Se.shadow);continue}const Re=Se.node,ct=(A?A(Re):Re.nodeType)===er.element,Zt=y(Re);if(Zt)for(let Gt=Zt.length-1;Gt>=0;--Gt)J.push({node:Zt[Gt],shadow:null});if(ct){const Gt=N?N(Re):null;if(typeof Gt=="string"&&Mt(Gt)==="template"){const Dn=Re.content;Ns(Dn)&&J.push({node:Dn,shadow:null})}}if(ct){const Gt=v(Re);Ns(Gt)&&J.push({node:null,shadow:Gt},{node:Gt,shadow:null})}}};return t.sanitize=function(Te){let B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=null,Se=null,Re=null,Xe=null;if(wt=!Te,wt&&(Te="<!-->"),typeof Te!="string"&&!Da(Te)&&(Te=EH(Te),typeof Te!="string"))throw Vr("dirty is not a string, aborting");if(!t.isSupported)return Te;Q?(be=le,we=Ae):Vu(B),(Z.uponSanitizeElement.length>0||Z.uponSanitizeAttribute.length>0)&&(be=bn(be)),Z.uponSanitizeAttribute.length>0&&(we=bn(we)),t.removed=[];const ct=Ne&&typeof Te!="string"&&Da(Te);if(ct){const Dn=N?N(Te):Te.nodeName;if(typeof Dn=="string"){const Hn=Mt(Dn);if(!be[Hn]||Ye[Hn])throw Vr("root node is forbidden and cannot be sanitized in-place")}if(po(Te))throw Vr("root node is clobbered and cannot be sanitized in-place");try{Ku(Te)}catch(Hn){throw Tx(Te),Hn}}else if(Da(Te))J=Nx("<!---->"),Se=J.ownerDocument.importNode(Te,!0),Se.nodeType===er.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?J=Se:J.appendChild(Se),Ku(Se);else{if(!_e&&!qe&&!Ke&&Te.indexOf("<")===-1)return T&&ut?z(Te):Te;if(J=Nx(Te),!J)return _e?null:ut?w:""}J&&W&&wr(J.firstChild);const Zt=wx(ct?Te:J);try{for(;Re=Zt.nextNode();)vx(Re),_x(Re),Ns(Re.content)&&fo(Re.content)}catch(Dn){throw ct&&Tx(Te),Dn}if(ct)return za(t.removed,Dn=>{Dn.element&&MA(Dn.element)}),qe&&Yu(Te),Te;if(_e){if(qe&&Yu(J),Be)for(Xe=re.call(J.ownerDocument);J.firstChild;)Xe.appendChild(J.firstChild);else Xe=J;return(we.shadowroot||we.shadowrootmode)&&(Xe=I.call(r,Xe,!0)),Xe}let Gt=Ke?J.outerHTML:J.innerHTML;return Ke&&be["!doctype"]&&J.ownerDocument&&J.ownerDocument.doctype&&J.ownerDocument.doctype.name&&sn(RH,J.ownerDocument.doctype.name)&&(Gt="<!DOCTYPE "+J.ownerDocument.doctype.name+`>
|
|
299
|
-
`+Gt),qe&&(Gt=co(Gt)),T&&ut?z(Gt):Gt},t.setConfig=function(){let Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vu(Te),Q=!0,le=be,Ae=we},t.clearConfig=function(){Ts=null,Q=!1,le=null,Ae=null,T=k,w=""},t.isValidAttribute=function(Te,B,J){Ts||Vu({});const Se=Mt(Te),Re=Mt(B);return Ax(Se,Re,J)},t.addHook=function(Te,B){typeof B=="function"&&Jt(Z,Te)&&_s(Z[Te],B)},t.removeHook=function(Te,B){if(Jt(Z,Te)){if(B!==void 0){const J=fH(Z[Te],B);return J===-1?void 0:mH(Z[Te],J,1)[0]}return mE(Z[Te])}},t.removeHooks=function(Te){Jt(Z,Te)&&(Z[Te]=[])},t.removeAllHooks=function(){Z=vE()},t}var PH=Jw();function BH(e){return PH(window).sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0,html:!0},ADD_TAGS:["foreignObject"],HTML_INTEGRATION_POINTS:{foreignobject:!0}})}function UH({code:e}){const t=g.useId().replace(/:/g,""),n=g.useRef(null),[r,s]=g.useState(null),[i,o]=g.useState(!1),[l,u]=g.useState("light");return g.useEffect(()=>{if(typeof document>"u")return;const c=document.documentElement.getAttribute("data-theme");(c==="dark"||c==="light")&&u(c)},[]),g.useEffect(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;const c=new MutationObserver(()=>{const d=document.documentElement.getAttribute("data-theme")||"light";u(d)});return c.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>c.disconnect()},[]),g.useEffect(()=>{let c=!1;return(async()=>{try{const d=(await Zw(async()=>{const{default:m}=await import("./mermaid.core.DzkwM3VX.js").then(b=>b.bl);return{default:m}},__vite__mapDeps([0,1]))).default;d.initialize({startOnLoad:!1,securityLevel:"loose",theme:l==="dark"?"dark":"default",fontFamily:"ui-sans-serif, system-ui, -apple-system, sans-serif",flowchart:{htmlLabels:!1,useMaxWidth:!1}});const p=await d.render(`mermaid-${t}`,e),f=BH(p.svg).replace(/(<svg[^>]*?)\s+width="[^"]*"/,'$1 width="100%"').replace(/(<svg[^>]*?)\s+height="[^"]*"/,'$1 height="auto"');c||s(f)}catch{c||o(!0)}})(),()=>{c=!0}},[e,t,l]),g.useEffect(()=>{n.current&&(n.current.innerHTML=r??"")},[r]),i?a.jsx("pre",{className:"text-xs font-mono p-3 bg-spur-surface-2 rounded border border-spur-border overflow-x-auto",children:a.jsx("code",{children:e})}):a.jsx("div",{ref:n,className:"mermaid-diagram","data-testid":"mermaid-diagram"})}function $H(e){return(e??"").match(/language-(\w+)/)?.[1]??null}function Oi(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Oi).join(""):typeof e=="object"&&"props"in e?Oi(e.props.children):""}function Jb({className:e,children:t,...n}){return $H(e)==="mermaid"?a.jsx(UH,{code:Oi(t).trim()}):a.jsx("code",{className:e,...n,children:t})}function ev({source:e,className:t,style:n}){return a.jsx(ia.Markdown,{source:e,className:t,style:n,wrapperElement:{"data-color-mode":"light"},components:{code:Jb}})}function zH(e){if(!e)return[];const t=e.split(/\r?\n/),n=[],r=new Map;let s=!1;for(const i of t){if(i.trim().startsWith("```")){s=!s;continue}if(s)continue;const l=i.match(/^(#{1,6})\s+(.+)$/);if(l?.[1]&&l[2]){const u=l[1].length,d=l[2].trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=d.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||`heading-${n.length+1}`,m=r.get(f)??0;r.set(f,m+1);const b=m===0?f:`${f}-${m}`;n.push({id:b,text:d,level:u})}}return n}function HH(){const e=new Map;return{nextId(t){const r=t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||"heading",s=e.get(r)??0;return e.set(r,s+1),s===0?r:`${r}-${s}`}}}function GH({markdown:e,scrollContainerRef:t,onClose:n}){const r=g.useMemo(()=>zH(e),[e]),[s,i]=g.useState(null);g.useEffect(()=>{const l=t?.current;if(!l||r.length===0)return;const u=()=>{const c=l.getBoundingClientRect().top;let d=null;for(const p of r){const f=document.getElementById(p.id);f&&f.getBoundingClientRect().top-c<=100&&(d=p.id)}d&&i(d)};return l.addEventListener("scroll",u,{passive:!0}),u(),()=>l.removeEventListener("scroll",u)},[r,t]);const o=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth",block:"start"})};return a.jsxs("aside",{id:"design-toc-dock","aria-label":"Table of Contents",className:"w-64 lg:w-72 shrink-0 rounded-lg border border-spur-border bg-base-200 shadow-xs flex flex-col overflow-hidden 3xl:absolute 3xl:top-0 3xl:bottom-0 3xl:left-[calc(100%_+_12px)] 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl","data-testid":"design-toc-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"📑"})," Table of Contents"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[r.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:r.length}),n&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent h-5 w-5 p-0 text-xs flex items-center justify-center cursor-pointer",onClick:n,"aria-label":"Close table of contents",title:"Close table of contents",children:"✕"})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-1.5 space-y-0.5",children:r.length===0?a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No headings in document."}):r.map(l=>{const u=s===l.id;let c="pl-2 text-xs font-semibold";return l.level===2?c="pl-4 text-xs font-medium":l.level===3?c="pl-6 text-xs text-spur-text-muted":l.level>=4&&(c="pl-8 text-[11px] text-spur-text-muted"),a.jsx("button",{type:"button",onClick:()=>o(l.id),title:l.text,className:`w-full text-left py-1 pr-2 rounded transition-colors truncate block cursor-pointer ${c} ${u?"bg-spur-accent/15 text-spur-accent font-semibold":"hover:bg-base-300 hover:text-spur-text text-spur-text/80"}`,children:l.text},l.id)})})]})}function WH({source:e,className:t}){const n=Qb(e),r=HH(),s=o=>{const l=`h${o}`;return({children:u,...c})=>{const p=Oi(u).trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=r.nextId(p);return a.jsx(l,{id:f,className:"scroll-mt-6 group",...c,children:u})}},i={code:Jb,h1:s(1),h2:s(2),h3:s(3),h4:s(4),h5:s(5),h6:s(6)};return a.jsx("div",{className:`design-markdown-container ${t??""}`,"data-testid":"design-markdown-body",children:a.jsx(ia.Markdown,{source:n,wrapperElement:{"data-color-mode":"light"},components:i})})}function qH(){const[e,t]=ap(),[n,r]=g.useState(null),[s,i]=g.useState(()=>e.get("file")),o=g.useRef({}),[l,u]=g.useState({}),[c,d]=g.useState(!0),[p,f]=g.useState(!0),[m,b]=g.useState(!1),[x,y]=g.useState(!0),[E,v]=g.useState(!1),[S,A]=g.useState(null),[N,T]=g.useState(null),[w,k]=g.useState(!1),F=g.useRef(null),C=g.useRef(null),$=g.useCallback(async I=>{try{y(!0);const Z=await H7(I);return r(Z),A(null),Z}catch(Z){return I?.aborted||A(Z instanceof Error?Z.message:String(Z)),null}finally{y(!1)}},[]),z=g.useCallback(async(I,Z)=>{if(!o.current[I])try{v(!0),T(null);const ie=await G7(I,Z);o.current[I]=ie,u(L=>({...L,[I]:ie}))}catch(ie){if(Z?.aborted)return;T(ie instanceof Error?ie.message:String(ie))}finally{v(!1)}},[]),M=e.get("file");g.useEffect(()=>{const I=new AbortController;return(async()=>{const Z=await $(I.signal);if(Z&&Z.length>0){if(M&&Z.some(L=>L.path===M))i(M);else if(!M){const L=Z[0]?.path;L&&i(L)}}})(),()=>I.abort()},[$,M]),g.useEffect(()=>{M&&M!==s&&i(M)},[M,s]),g.useEffect(()=>{if(!s)return;const I=new AbortController;return z(s,I.signal),()=>I.abort()},[s,z]);const G=I=>{i(I),f(!0),t({file:I},{replace:!0}),F.current&&(F.current.scrollTop=0)},H=()=>{s&&(navigator.clipboard.writeText(s),k(!0),setTimeout(()=>k(!1),2e3))},j=s?l[s]:null,{frontmatterRaw:q,frontmatter:re,body:pe}=g.useMemo(()=>j?.content?Kw(j.content):{frontmatterRaw:null,frontmatter:null,body:""},[j?.content]);return S?a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load design documents: ",S]}):x&&n===null?a.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Loading design documents…"}):a.jsxs("div",{className:"relative h-full w-full p-4 overflow-hidden","data-designs-shell":!0,children:[a.jsxs("div",{className:"flex flex-col h-full w-full max-w-full 3xl:max-w-[1200px] 4xl:max-w-[1600px] mx-auto gap-3","data-designs-workspace":!0,children:[a.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-spur-border pb-3 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:"📐"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight text-spur-text",children:"Designs"}),a.jsx("p",{className:"text-xs text-spur-text-muted",children:"Design documents, architecture specifications, and surface contracts"})]})]}),a.jsxs("div",{className:"flex items-center gap-1","data-designs-actions":!0,children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>d(I=>!I),"aria-label":c?"Collapse design file list":"Expand design file list","aria-expanded":c,"aria-controls":"design-files-dock",title:c?"Collapse design file list":"Expand design file list",children:c?"◧":"▶"}),s&&j?.content&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>f(I=>!I),"aria-label":p?"Collapse table of contents":"Expand table of contents","aria-expanded":p,"aria-controls":"design-toc-dock",title:p?"Collapse table of contents":"Expand table of contents",children:p?"📑":"📖"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>{(async()=>(await $(),s&&(u(I=>{const Z={...I};return delete Z[s],Z}),z(s))))()},"aria-label":"Refresh design documents",title:"Refresh design documents",children:"🔄"})]})]}),a.jsxs("div",{className:"flex-1 min-h-0 flex items-stretch gap-3 overflow-hidden 3xl:relative 3xl:block 3xl:overflow-visible",ref:C,children:[a.jsxs("div",{id:"design-files-dock",hidden:!c,className:`${c?"flex":"hidden"} w-64 lg:w-72 shrink-0 flex-col overflow-hidden rounded-lg border border-spur-border bg-base-200 shadow-xs 3xl:absolute 3xl:right-[calc(100%_+_12px)] 3xl:top-0 3xl:bottom-0 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl`,"data-testid":"design-files-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"📐"})," Design Docs"]}),n&&n.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:n.length})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:n&&n.length>0?a.jsx(nH,{files:n,selectedPath:s,onSelect:G}):a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No design documents found."})})]}),a.jsx("div",{className:"flex-1 min-w-0 h-full overflow-hidden rounded-lg border border-spur-border bg-base-100 relative 3xl:w-full 3xl:flex-none","data-testid":"design-workspace",children:a.jsx("div",{className:"w-full h-full overflow-y-auto",ref:F,children:s?a.jsxs("div",{className:"flex flex-col min-h-full",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 py-3 border-b border-spur-border bg-base-100/90 backdrop-blur-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded bg-base-200 text-spur-text-muted border border-spur-border shrink-0",children:s}),j?.title&&a.jsx("h2",{className:"text-sm font-semibold text-spur-text truncate",children:j.title})]}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent flex items-center gap-1 shrink-0",onClick:()=>b(!0),"aria-label":"View document metadata",title:"View document metadata","data-testid":"metadata-toggle",children:"ℹ Metadata"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-text shrink-0",onClick:H,"aria-label":"Copy file path",title:"Copy file path",children:w?"✓ Copied":"📋 Copy Path"})]})]}),a.jsx("div",{className:"p-6 md:p-8 flex-1","data-testid":"design-body-container",children:E&&!j?a.jsx("div",{className:"flex items-center justify-center py-20 text-spur-text-muted text-sm",children:"Loading document content…"}):N?a.jsxs("div",{className:"p-4 text-sm text-error bg-error/10 rounded-md border border-error/20",children:["Failed to load document: ",N]}):j?a.jsx(WH,{source:pe}):null})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-spur-text-muted gap-2",children:[a.jsx("span",{className:"text-3xl","aria-hidden":"true",children:"📐"}),a.jsx("span",{className:"text-sm font-medium",children:"Select a design document to view"})]})})}),s&&j?.content&&p&&a.jsx(GH,{markdown:pe,scrollContainerRef:F,onClose:()=>f(!1)})]})]}),a.jsx(lw,{open:m,onClose:()=>b(!1),title:j?.title,filePath:s,frontmatterRaw:q,frontmatter:re})]})}const VH={id:"designs",name:"Designs",icon:"📐",route:"designs",component:qH,sidebarLabel:"Designs",description:"Design documents, architecture specifications, and surface contracts",order:25},YH=Object.freeze(Object.defineProperty({__proto__:null,module:VH},Symbol.toStringTag,{value:"Module"})),dr=()=>`${nt()}/features`;async function KH(e){const t=await Ge(new Request(dr(),{signal:e}));if(!t.ok)throw new Error(`feature list fetch failed: ${t.status}`);const r=await t.json();if(!r.ok||!Array.isArray(r.data))throw new Error("feature list: invalid response shape");return r.data}async function AE(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e)}`,{signal:t}));if(!n.ok)throw new Error(`feature show fetch failed: ${n.status}`);const s=await n.json();if(!s.ok||!s.data)throw new Error("feature show: invalid response shape");return s.data}async function ZH(e,t,n){const r=await Ge(new Request(`${dr()}/${encodeURIComponent(e)}/status`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,toStatus:t}),signal:n})),s=await r.json();if(!r.ok){const o=s;throw new Error(o.error?.message??`transition failed: ${r.status}`)}return s.data?.status??t}async function XH(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/body`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const s=await n.json();throw new Error(s.error?.message??`body update failed: ${n.status}`)}}async function QH(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/action`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`action dispatch failed: ${n.status}`)}return await n.json()}async function tv(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/children`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`create child failed: ${n.status}`)}return await n.json()}async function JH(e,t){const n=await Ge(new Request(dr(),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e}),signal:t}));if(!n.ok){const o=await n.json();throw new Error(o.error?.message??`create feature failed: ${n.status}`)}const s=await n.json();if(!s.ok||!s.data)throw new Error("create feature: invalid response shape");return s.data}async function eG(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/tasks`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`create task failed: ${n.status}`)}return await n.json()}async function tG(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/link`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`link task failed: ${n.status}`)}return await n.json()}async function nG(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/sync`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`sync failed: ${n.status}`)}return await n.json()}function Li({targetVar:e,onResizeEnd:t,direction:n="horizontal",invert:r=!1}){const s=g.useRef(null),i=g.useCallback(l=>{l.preventDefault();const u=document.documentElement,d=getComputedStyle(u).getPropertyValue(e).trim(),p=parseFloat(d)||0;s.current={x:l.clientX,y:l.clientY,w:p},l.target.setPointerCapture(l.pointerId);const f=b=>{if(!s.current)return;const x=n==="horizontal"?b.clientX-s.current.x:b.clientY-s.current.y,y=r?-x:x,E=Math.max(0,s.current.w+y);u.style.setProperty(e,`${E}px`)},m=()=>{if(!s.current)return;const b=getComputedStyle(u).getPropertyValue(e).trim(),x=parseFloat(b)||s.current.w;t(Math.round(x)),s.current=null,window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",m)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",m,{once:!0})},[e,t,n,r]),o=n==="horizontal";return a.jsx("hr",{"data-testid":`resize-handle-${o?"h":"v"}`,"aria-orientation":o?"vertical":"horizontal","aria-label":o?"Resize sidebar":"Resize panel",tabIndex:0,className:"resize-handle shrink-0 bg-spur-border hover:bg-spur-accent cursor-col-resize transition-colors border-0",style:{width:o?4:"100%",height:o?"100%":4,margin:0},onPointerDown:i})}const kE="spur:new-task-panel-width",_E=384,Uc=384;function CE({id:e,label:t,placeholder:n,value:r,mode:s,onChange:i,onModeChange:o,disabled:l}){return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[a.jsxs("label",{htmlFor:e,className:"text-xs font-semibold text-spur-text-muted uppercase tracking-wide",children:[t," ",a.jsx("span",{className:"text-spur-text-muted font-normal",children:"(optional, markdown)"})]}),a.jsxs("fieldset",{className:"flex items-center gap-1",children:[a.jsxs("legend",{className:"sr-only",children:[t," mode"]}),a.jsx(Fe,{type:"button",variant:s==="edit"?"primary":"ghost",size:"xs",onClick:()=>o("edit"),disabled:l,"aria-pressed":s==="edit",children:"Edit"}),a.jsx(Fe,{type:"button",variant:s==="preview"?"primary":"ghost",size:"xs",onClick:()=>o("preview"),disabled:l,"aria-pressed":s==="preview",children:"Preview"})]})]}),s==="edit"?a.jsx("div",{className:"min-h-40","data-testid":`${e}-editor`,children:a.jsx(ia,{value:r,onChange:u=>i(u??""),height:160,textareaProps:{id:e,placeholder:n,disabled:l,"aria-label":t},"data-color-mode":"dark"})}):a.jsx("div",{className:"min-h-40 rounded border border-spur-border bg-spur-bg p-3 text-sm text-spur-text overflow-y-auto","data-testid":`${e}-preview`,children:r.trim()?a.jsx(ia.Markdown,{source:r,"data-color-mode":"dark"}):a.jsx("p",{className:"text-xs text-spur-text-muted",children:n})})]})}function nv({open:e,onClose:t,onCreated:n,folder:r,featureId:s}){const[i,o]=g.useState(""),[l,u]=g.useState(""),[c,d]=g.useState(""),[p,f]=g.useState("edit"),[m,b]=g.useState("edit"),[x,y]=g.useState("standard"),[E,v]=g.useState(!1),[S,A]=g.useState(""),[N,T]=g.useState(!1),[w,k]=g.useState(()=>{if(typeof window>"u")return _E;try{const z=Number.parseFloat(window.localStorage.getItem(kE)??"");if(Number.isFinite(z)&&z>0)return Math.max(Uc,Math.min(z,window.innerWidth*.9))}catch{}return _E}),F=N&&i.trim()===""?"Name is required":"";g.useEffect(()=>{document.documentElement.style.setProperty("--new-task-panel-w",`${w}px`)},[w]);const C=()=>{E||(o(""),u(""),d(""),f("edit"),b("edit"),y("standard"),A(""),T(!1),t())},$=async()=>{T(!0);const z=i.trim();if(z!==""){v(!0),A("");try{const G=(await Pt.task.create({title:z,folder:r,template:x,featureId:s})).data.wbs,H=[];if(l.trim()&&H.push(`### Background
|
|
299
|
+
`+Gt),qe&&(Gt=co(Gt)),T&&ut?z(Gt):Gt},t.setConfig=function(){let Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vu(Te),Q=!0,le=be,Ae=we},t.clearConfig=function(){Ts=null,Q=!1,le=null,Ae=null,T=k,w=""},t.isValidAttribute=function(Te,B,J){Ts||Vu({});const Se=Mt(Te),Re=Mt(B);return Ax(Se,Re,J)},t.addHook=function(Te,B){typeof B=="function"&&Jt(Z,Te)&&_s(Z[Te],B)},t.removeHook=function(Te,B){if(Jt(Z,Te)){if(B!==void 0){const J=fH(Z[Te],B);return J===-1?void 0:mH(Z[Te],J,1)[0]}return mE(Z[Te])}},t.removeHooks=function(Te){Jt(Z,Te)&&(Z[Te]=[])},t.removeAllHooks=function(){Z=vE()},t}var PH=Jw();function BH(e){return PH(window).sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0,html:!0},ADD_TAGS:["foreignObject"],HTML_INTEGRATION_POINTS:{foreignobject:!0}})}function UH({code:e}){const t=g.useId().replace(/:/g,""),n=g.useRef(null),[r,s]=g.useState(null),[i,o]=g.useState(!1),[l,u]=g.useState("light");return g.useEffect(()=>{if(typeof document>"u")return;const c=document.documentElement.getAttribute("data-theme");(c==="dark"||c==="light")&&u(c)},[]),g.useEffect(()=>{if(typeof MutationObserver>"u"||typeof document>"u")return;const c=new MutationObserver(()=>{const d=document.documentElement.getAttribute("data-theme")||"light";u(d)});return c.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),()=>c.disconnect()},[]),g.useEffect(()=>{let c=!1;return(async()=>{try{const d=(await Zw(async()=>{const{default:m}=await import("./mermaid.core.BK7P2Sr_.js").then(b=>b.bl);return{default:m}},__vite__mapDeps([0,1]))).default;d.initialize({startOnLoad:!1,securityLevel:"loose",theme:l==="dark"?"dark":"default",fontFamily:"ui-sans-serif, system-ui, -apple-system, sans-serif",flowchart:{htmlLabels:!1,useMaxWidth:!1}});const p=await d.render(`mermaid-${t}`,e),f=BH(p.svg).replace(/(<svg[^>]*?)\s+width="[^"]*"/,'$1 width="100%"').replace(/(<svg[^>]*?)\s+height="[^"]*"/,'$1 height="auto"');c||s(f)}catch{c||o(!0)}})(),()=>{c=!0}},[e,t,l]),g.useEffect(()=>{n.current&&(n.current.innerHTML=r??"")},[r]),i?a.jsx("pre",{className:"text-xs font-mono p-3 bg-spur-surface-2 rounded border border-spur-border overflow-x-auto",children:a.jsx("code",{children:e})}):a.jsx("div",{ref:n,className:"mermaid-diagram","data-testid":"mermaid-diagram"})}function $H(e){return(e??"").match(/language-(\w+)/)?.[1]??null}function Oi(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"?String(e):Array.isArray(e)?e.map(Oi).join(""):typeof e=="object"&&"props"in e?Oi(e.props.children):""}function Jb({className:e,children:t,...n}){return $H(e)==="mermaid"?a.jsx(UH,{code:Oi(t).trim()}):a.jsx("code",{className:e,...n,children:t})}function ev({source:e,className:t,style:n}){return a.jsx(ia.Markdown,{source:e,className:t,style:n,wrapperElement:{"data-color-mode":"light"},components:{code:Jb}})}function zH(e){if(!e)return[];const t=e.split(/\r?\n/),n=[],r=new Map;let s=!1;for(const i of t){if(i.trim().startsWith("```")){s=!s;continue}if(s)continue;const l=i.match(/^(#{1,6})\s+(.+)$/);if(l?.[1]&&l[2]){const u=l[1].length,d=l[2].trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=d.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||`heading-${n.length+1}`,m=r.get(f)??0;r.set(f,m+1);const b=m===0?f:`${f}-${m}`;n.push({id:b,text:d,level:u})}}return n}function HH(){const e=new Map;return{nextId(t){const r=t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||"heading",s=e.get(r)??0;return e.set(r,s+1),s===0?r:`${r}-${s}`}}}function GH({markdown:e,scrollContainerRef:t,onClose:n}){const r=g.useMemo(()=>zH(e),[e]),[s,i]=g.useState(null);g.useEffect(()=>{const l=t?.current;if(!l||r.length===0)return;const u=()=>{const c=l.getBoundingClientRect().top;let d=null;for(const p of r){const f=document.getElementById(p.id);f&&f.getBoundingClientRect().top-c<=100&&(d=p.id)}d&&i(d)};return l.addEventListener("scroll",u,{passive:!0}),u(),()=>l.removeEventListener("scroll",u)},[r,t]);const o=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth",block:"start"})};return a.jsxs("aside",{id:"design-toc-dock","aria-label":"Table of Contents",className:"w-64 lg:w-72 shrink-0 rounded-lg border border-spur-border bg-base-200 shadow-xs flex flex-col overflow-hidden 3xl:absolute 3xl:top-0 3xl:bottom-0 3xl:left-[calc(100%_+_12px)] 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl","data-testid":"design-toc-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"📑"})," Table of Contents"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[r.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:r.length}),n&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent h-5 w-5 p-0 text-xs flex items-center justify-center cursor-pointer",onClick:n,"aria-label":"Close table of contents",title:"Close table of contents",children:"✕"})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-1.5 space-y-0.5",children:r.length===0?a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No headings in document."}):r.map(l=>{const u=s===l.id;let c="pl-2 text-xs font-semibold";return l.level===2?c="pl-4 text-xs font-medium":l.level===3?c="pl-6 text-xs text-spur-text-muted":l.level>=4&&(c="pl-8 text-[11px] text-spur-text-muted"),a.jsx("button",{type:"button",onClick:()=>o(l.id),title:l.text,className:`w-full text-left py-1 pr-2 rounded transition-colors truncate block cursor-pointer ${c} ${u?"bg-spur-accent/15 text-spur-accent font-semibold":"hover:bg-base-300 hover:text-spur-text text-spur-text/80"}`,children:l.text},l.id)})})]})}function WH({source:e,className:t}){const n=Qb(e),r=HH(),s=o=>{const l=`h${o}`;return({children:u,...c})=>{const p=Oi(u).trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=r.nextId(p);return a.jsx(l,{id:f,className:"scroll-mt-6 group",...c,children:u})}},i={code:Jb,h1:s(1),h2:s(2),h3:s(3),h4:s(4),h5:s(5),h6:s(6)};return a.jsx("div",{className:`design-markdown-container ${t??""}`,"data-testid":"design-markdown-body",children:a.jsx(ia.Markdown,{source:n,wrapperElement:{"data-color-mode":"light"},components:i})})}function qH(){const[e,t]=ap(),[n,r]=g.useState(null),[s,i]=g.useState(()=>e.get("file")),o=g.useRef({}),[l,u]=g.useState({}),[c,d]=g.useState(!0),[p,f]=g.useState(!0),[m,b]=g.useState(!1),[x,y]=g.useState(!0),[E,v]=g.useState(!1),[S,A]=g.useState(null),[N,T]=g.useState(null),[w,k]=g.useState(!1),F=g.useRef(null),C=g.useRef(null),$=g.useCallback(async I=>{try{y(!0);const Z=await H7(I);return r(Z),A(null),Z}catch(Z){return I?.aborted||A(Z instanceof Error?Z.message:String(Z)),null}finally{y(!1)}},[]),z=g.useCallback(async(I,Z)=>{if(!o.current[I])try{v(!0),T(null);const ie=await G7(I,Z);o.current[I]=ie,u(L=>({...L,[I]:ie}))}catch(ie){if(Z?.aborted)return;T(ie instanceof Error?ie.message:String(ie))}finally{v(!1)}},[]),M=e.get("file");g.useEffect(()=>{const I=new AbortController;return(async()=>{const Z=await $(I.signal);if(Z&&Z.length>0){if(M&&Z.some(L=>L.path===M))i(M);else if(!M){const L=Z[0]?.path;L&&i(L)}}})(),()=>I.abort()},[$,M]),g.useEffect(()=>{M&&M!==s&&i(M)},[M,s]),g.useEffect(()=>{if(!s)return;const I=new AbortController;return z(s,I.signal),()=>I.abort()},[s,z]);const G=I=>{i(I),f(!0),t({file:I},{replace:!0}),F.current&&(F.current.scrollTop=0)},H=()=>{s&&(navigator.clipboard.writeText(s),k(!0),setTimeout(()=>k(!1),2e3))},j=s?l[s]:null,{frontmatterRaw:q,frontmatter:re,body:pe}=g.useMemo(()=>j?.content?Kw(j.content):{frontmatterRaw:null,frontmatter:null,body:""},[j?.content]);return S?a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load design documents: ",S]}):x&&n===null?a.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Loading design documents…"}):a.jsxs("div",{className:"relative h-full w-full p-4 overflow-hidden","data-designs-shell":!0,children:[a.jsxs("div",{className:"flex flex-col h-full w-full max-w-full 3xl:max-w-[1200px] 4xl:max-w-[1600px] mx-auto gap-3","data-designs-workspace":!0,children:[a.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-spur-border pb-3 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:"📐"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight text-spur-text",children:"Designs"}),a.jsx("p",{className:"text-xs text-spur-text-muted",children:"Design documents, architecture specifications, and surface contracts"})]})]}),a.jsxs("div",{className:"flex items-center gap-1","data-designs-actions":!0,children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>d(I=>!I),"aria-label":c?"Collapse design file list":"Expand design file list","aria-expanded":c,"aria-controls":"design-files-dock",title:c?"Collapse design file list":"Expand design file list",children:c?"◧":"▶"}),s&&j?.content&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>f(I=>!I),"aria-label":p?"Collapse table of contents":"Expand table of contents","aria-expanded":p,"aria-controls":"design-toc-dock",title:p?"Collapse table of contents":"Expand table of contents",children:p?"📑":"📖"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>{(async()=>(await $(),s&&(u(I=>{const Z={...I};return delete Z[s],Z}),z(s))))()},"aria-label":"Refresh design documents",title:"Refresh design documents",children:"🔄"})]})]}),a.jsxs("div",{className:"flex-1 min-h-0 flex items-stretch gap-3 overflow-hidden 3xl:relative 3xl:block 3xl:overflow-visible",ref:C,children:[a.jsxs("div",{id:"design-files-dock",hidden:!c,className:`${c?"flex":"hidden"} w-64 lg:w-72 shrink-0 flex-col overflow-hidden rounded-lg border border-spur-border bg-base-200 shadow-xs 3xl:absolute 3xl:right-[calc(100%_+_12px)] 3xl:top-0 3xl:bottom-0 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl`,"data-testid":"design-files-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"📐"})," Design Docs"]}),n&&n.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:n.length})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:n&&n.length>0?a.jsx(nH,{files:n,selectedPath:s,onSelect:G}):a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No design documents found."})})]}),a.jsx("div",{className:"flex-1 min-w-0 h-full overflow-hidden rounded-lg border border-spur-border bg-base-100 relative 3xl:w-full 3xl:flex-none","data-testid":"design-workspace",children:a.jsx("div",{className:"w-full h-full overflow-y-auto",ref:F,children:s?a.jsxs("div",{className:"flex flex-col min-h-full",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 py-3 border-b border-spur-border bg-base-100/90 backdrop-blur-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded bg-base-200 text-spur-text-muted border border-spur-border shrink-0",children:s}),j?.title&&a.jsx("h2",{className:"text-sm font-semibold text-spur-text truncate",children:j.title})]}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent flex items-center gap-1 shrink-0",onClick:()=>b(!0),"aria-label":"View document metadata",title:"View document metadata","data-testid":"metadata-toggle",children:"ℹ Metadata"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-text shrink-0",onClick:H,"aria-label":"Copy file path",title:"Copy file path",children:w?"✓ Copied":"📋 Copy Path"})]})]}),a.jsx("div",{className:"p-6 md:p-8 flex-1","data-testid":"design-body-container",children:E&&!j?a.jsx("div",{className:"flex items-center justify-center py-20 text-spur-text-muted text-sm",children:"Loading document content…"}):N?a.jsxs("div",{className:"p-4 text-sm text-error bg-error/10 rounded-md border border-error/20",children:["Failed to load document: ",N]}):j?a.jsx(WH,{source:pe}):null})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-spur-text-muted gap-2",children:[a.jsx("span",{className:"text-3xl","aria-hidden":"true",children:"📐"}),a.jsx("span",{className:"text-sm font-medium",children:"Select a design document to view"})]})})}),s&&j?.content&&p&&a.jsx(GH,{markdown:pe,scrollContainerRef:F,onClose:()=>f(!1)})]})]}),a.jsx(lw,{open:m,onClose:()=>b(!1),title:j?.title,filePath:s,frontmatterRaw:q,frontmatter:re})]})}const VH={id:"designs",name:"Designs",icon:"📐",route:"designs",component:qH,sidebarLabel:"Designs",description:"Design documents, architecture specifications, and surface contracts",order:25},YH=Object.freeze(Object.defineProperty({__proto__:null,module:VH},Symbol.toStringTag,{value:"Module"})),dr=()=>`${nt()}/features`;async function KH(e){const t=await Ge(new Request(dr(),{signal:e}));if(!t.ok)throw new Error(`feature list fetch failed: ${t.status}`);const r=await t.json();if(!r.ok||!Array.isArray(r.data))throw new Error("feature list: invalid response shape");return r.data}async function AE(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e)}`,{signal:t}));if(!n.ok)throw new Error(`feature show fetch failed: ${n.status}`);const s=await n.json();if(!s.ok||!s.data)throw new Error("feature show: invalid response shape");return s.data}async function ZH(e,t,n){const r=await Ge(new Request(`${dr()}/${encodeURIComponent(e)}/status`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({id:e,toStatus:t}),signal:n})),s=await r.json();if(!r.ok){const o=s;throw new Error(o.error?.message??`transition failed: ${r.status}`)}return s.data?.status??t}async function XH(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/body`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const s=await n.json();throw new Error(s.error?.message??`body update failed: ${n.status}`)}}async function QH(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/action`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`action dispatch failed: ${n.status}`)}return await n.json()}async function tv(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/children`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`create child failed: ${n.status}`)}return await n.json()}async function JH(e,t){const n=await Ge(new Request(dr(),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:e}),signal:t}));if(!n.ok){const o=await n.json();throw new Error(o.error?.message??`create feature failed: ${n.status}`)}const s=await n.json();if(!s.ok||!s.data)throw new Error("create feature: invalid response shape");return s.data}async function eG(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/tasks`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`create task failed: ${n.status}`)}return await n.json()}async function tG(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/link`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`link task failed: ${n.status}`)}return await n.json()}async function nG(e,t){const n=await Ge(new Request(`${dr()}/${encodeURIComponent(e.id)}/sync`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e),signal:t}));if(!n.ok){const i=await n.json();throw new Error(i.error?.message??`sync failed: ${n.status}`)}return await n.json()}function Li({targetVar:e,onResizeEnd:t,direction:n="horizontal",invert:r=!1}){const s=g.useRef(null),i=g.useCallback(l=>{l.preventDefault();const u=document.documentElement,d=getComputedStyle(u).getPropertyValue(e).trim(),p=parseFloat(d)||0;s.current={x:l.clientX,y:l.clientY,w:p},l.target.setPointerCapture(l.pointerId);const f=b=>{if(!s.current)return;const x=n==="horizontal"?b.clientX-s.current.x:b.clientY-s.current.y,y=r?-x:x,E=Math.max(0,s.current.w+y);u.style.setProperty(e,`${E}px`)},m=()=>{if(!s.current)return;const b=getComputedStyle(u).getPropertyValue(e).trim(),x=parseFloat(b)||s.current.w;t(Math.round(x)),s.current=null,window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",m)};window.addEventListener("pointermove",f),window.addEventListener("pointerup",m,{once:!0})},[e,t,n,r]),o=n==="horizontal";return a.jsx("hr",{"data-testid":`resize-handle-${o?"h":"v"}`,"aria-orientation":o?"vertical":"horizontal","aria-label":o?"Resize sidebar":"Resize panel",tabIndex:0,className:"resize-handle shrink-0 bg-spur-border hover:bg-spur-accent cursor-col-resize transition-colors border-0",style:{width:o?4:"100%",height:o?"100%":4,margin:0},onPointerDown:i})}const kE="spur:new-task-panel-width",_E=384,Uc=384;function CE({id:e,label:t,placeholder:n,value:r,mode:s,onChange:i,onModeChange:o,disabled:l}){return a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[a.jsxs("label",{htmlFor:e,className:"text-xs font-semibold text-spur-text-muted uppercase tracking-wide",children:[t," ",a.jsx("span",{className:"text-spur-text-muted font-normal",children:"(optional, markdown)"})]}),a.jsxs("fieldset",{className:"flex items-center gap-1",children:[a.jsxs("legend",{className:"sr-only",children:[t," mode"]}),a.jsx(Fe,{type:"button",variant:s==="edit"?"primary":"ghost",size:"xs",onClick:()=>o("edit"),disabled:l,"aria-pressed":s==="edit",children:"Edit"}),a.jsx(Fe,{type:"button",variant:s==="preview"?"primary":"ghost",size:"xs",onClick:()=>o("preview"),disabled:l,"aria-pressed":s==="preview",children:"Preview"})]})]}),s==="edit"?a.jsx("div",{className:"min-h-40","data-testid":`${e}-editor`,children:a.jsx(ia,{value:r,onChange:u=>i(u??""),height:160,textareaProps:{id:e,placeholder:n,disabled:l,"aria-label":t},"data-color-mode":"dark"})}):a.jsx("div",{className:"min-h-40 rounded border border-spur-border bg-spur-bg p-3 text-sm text-spur-text overflow-y-auto","data-testid":`${e}-preview`,children:r.trim()?a.jsx(ia.Markdown,{source:r,"data-color-mode":"dark"}):a.jsx("p",{className:"text-xs text-spur-text-muted",children:n})})]})}function nv({open:e,onClose:t,onCreated:n,folder:r,featureId:s}){const[i,o]=g.useState(""),[l,u]=g.useState(""),[c,d]=g.useState(""),[p,f]=g.useState("edit"),[m,b]=g.useState("edit"),[x,y]=g.useState("standard"),[E,v]=g.useState(!1),[S,A]=g.useState(""),[N,T]=g.useState(!1),[w,k]=g.useState(()=>{if(typeof window>"u")return _E;try{const z=Number.parseFloat(window.localStorage.getItem(kE)??"");if(Number.isFinite(z)&&z>0)return Math.max(Uc,Math.min(z,window.innerWidth*.9))}catch{}return _E}),F=N&&i.trim()===""?"Name is required":"";g.useEffect(()=>{document.documentElement.style.setProperty("--new-task-panel-w",`${w}px`)},[w]);const C=()=>{E||(o(""),u(""),d(""),f("edit"),b("edit"),y("standard"),A(""),T(!1),t())},$=async()=>{T(!0);const z=i.trim();if(z!==""){v(!0),A("");try{const G=(await Pt.task.create({title:z,folder:r,template:x,featureId:s})).data.wbs,H=[];if(l.trim()&&H.push(`### Background
|
|
300
300
|
${l.trim()}`),c.trim()&&H.push(`### Requirements
|
|
301
301
|
${c.trim()}`),H.length>0)try{await Pt.task.body({wbs:G,body:H.join(`
|
|
302
302
|
|
|
@@ -307,7 +307,7 @@ ${c.trim()}`),H.length>0)try{await Pt.task.body({wbs:G,body:H.join(`
|
|
|
307
307
|
`),n=[];let r=0;for(const s of t){const i=`json-line-${r++}-${s.slice(0,16)}`,o=s.split(/("(?:[^"\\]|\\.)*")/g),l=[];let u=0;for(const c of o){const d=`${i}-p-${u++}`;if(c.startsWith('"')&&c.endsWith('"')){const p=s.indexOf(c)<s.indexOf(":")&&s.includes(":");l.push(a.jsx("span",{className:p?"text-sky-300 font-semibold":"text-emerald-400",children:c},d))}else/\b(true|false|null)\b/.test(c)?l.push(a.jsx("span",{className:"text-purple-400",children:c},d)):/\b\d+(\.\d+)?\b/.test(c)?l.push(a.jsx("span",{className:"text-amber-300",children:c},d)):l.push(a.jsx("span",{className:"text-base-content/80",children:c},d))}n.push(a.jsx("div",{className:"leading-5 whitespace-pre",children:l},i))}return n}const MG=e=>{const t=e.split(`
|
|
308
308
|
`),n=[];let r=0;for(const s of t){const i=`xml-line-${r++}-${s.slice(0,16)}`,o=/(<!--[\s\S]*?-->|<\/?[a-zA-Z0-9_:-]+(?:(?:\s+[a-zA-Z0-9_:-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*\/?>)|&[a-zA-Z0-9#]+;|[^<&]+|<)/g,l=[];let u=0,c=o.exec(s);for(;c!==null;){const d=c[0],p=`${i}-tok-${u++}`;if(d.startsWith("<!--"))l.push(a.jsx("span",{className:"text-base-content/40 italic",children:d},p));else if(d.startsWith("<")&&(d.endsWith(">")||d.length>1)){const f=d.match(/^(<\/?[a-zA-Z0-9_:-]+)([\s\S]*?)(\/?>)$/);if(f?.[1]){const m=f[1],b=f[2]??"",x=f[3]??">",y=[];let E=0;const S=m.startsWith("</")?"</":"<",A=m.slice(S.length);if(y.push(a.jsx("span",{className:"text-sky-400/60 font-mono",children:S},`${p}-bracket-1`),a.jsx("span",{className:"text-sky-300 font-semibold font-mono",children:A},`${p}-name`)),b){const N=/(\s+)([a-zA-Z0-9_:-]+)(?:(=)("[^"]*"|'[^']*'|[^\s>]+))?/g;let T=N.exec(b),w=0;for(;T!==null;){const[k,F,C,$,z]=T;T.index>w&&y.push(a.jsx("span",{children:b.slice(w,T.index)},`${p}-ws-${E++}`)),y.push(a.jsx("span",{children:F},`${p}-attr-ws-${E++}`),a.jsx("span",{className:"text-cyan-300 font-mono",children:C},`${p}-attr-name-${E++}`)),$&&y.push(a.jsx("span",{className:"text-base-content/50",children:"="},`${p}-attr-eq-${E++}`)),z&&y.push(a.jsx("span",{className:"text-emerald-300 font-mono",children:z},`${p}-attr-val-${E++}`)),w=T.index+k.length,T=N.exec(b)}w<b.length&&y.push(a.jsx("span",{children:b.slice(w)},`${p}-attr-rest-${E++}`))}y.push(a.jsx("span",{className:"text-sky-400/60 font-mono",children:x},`${p}-bracket-2`)),l.push(a.jsx("span",{children:y},p))}else l.push(a.jsx("span",{className:"text-sky-300 font-semibold",children:d},p))}else d.startsWith("&")&&d.endsWith(";")?l.push(a.jsx("span",{className:"text-amber-300 font-semibold",children:d},p)):l.push(a.jsx("span",{className:"text-slate-100",children:d},p));c=o.exec(s)}n.push(a.jsx("div",{className:"leading-5",children:l.length>0?l:" "},i))}return n},FG=e=>{const t=e.split(`
|
|
309
309
|
`),n=[];let r=!1,s=0;for(let i=0;i<t.length;i++){const o=t[i]??"",l=`md-line-${s++}-${o.slice(0,16)}`,u=o.trim();if(u==="---"){r=i===0?!0:!r,n.push(a.jsx("div",{className:"text-purple-400 font-bold leading-5",children:o},l));continue}if(r){const m=o.indexOf(":");if(m>0){const b=o.slice(0,m),x=o.slice(m+1);n.push(a.jsxs("div",{className:"leading-5",children:[a.jsx("span",{className:"text-cyan-300 font-semibold",children:b}),a.jsx("span",{className:"text-base-content/50",children:":"}),a.jsx("span",{className:"text-emerald-300",children:x})]},l));continue}n.push(a.jsx("div",{className:"text-slate-300 leading-5",children:o||" "},l));continue}if(u.startsWith("```")){n.push(a.jsx("div",{className:"text-pink-400 font-mono font-semibold leading-5",children:o},l));continue}if(u.startsWith("#")){n.push(a.jsx("div",{className:"text-sky-300 font-bold leading-5",children:o},l));continue}if(u.startsWith(">")){n.push(a.jsx("div",{className:"text-emerald-300/80 italic pl-1.5 border-l border-emerald-500/40 leading-5",children:o},l));continue}const c=o.match(/^(\s*[-*+]|\s*\d+\.)/);if(c){n.push(a.jsxs("div",{className:"leading-5",children:[a.jsx("span",{className:"text-amber-300 font-semibold",children:c[0]}),a.jsx("span",{className:"text-slate-100",children:o.slice(c[0].length)})]},l));continue}const d=o.split(/(`[^`]+`|\*\*[^*]+\*\*|\[[^\]]+\]\([^)]+\))/g),p=[];let f=0;for(const m of d){const b=`${l}-p-${f++}`;m.startsWith("`")&&m.endsWith("`")?p.push(a.jsx("span",{className:"text-emerald-300 bg-white/10 px-1 rounded font-mono",children:m},b)):m.startsWith("**")&&m.endsWith("**")?p.push(a.jsx("span",{className:"text-amber-200 font-bold",children:m},b)):m.startsWith("[")&&m.includes("](")&&m.endsWith(")")?p.push(a.jsx("span",{className:"text-sky-400 underline",children:m},b)):p.push(a.jsx("span",{className:"text-slate-100",children:m},b))}n.push(a.jsx("div",{className:"leading-5",children:p.length>0?p:" "},l))}return n};function PG(e,t){if(t&&/^(bash|shell)$/i.test(t.trim()))return"bash";const n=e.trim();return n?n.startsWith("<")&&n.endsWith(">")?"xml":n.startsWith("{")&&n.endsWith("}")?"json":n.split(`
|
|
310
|
-
`)[0]?.trim()==="---"?"markdown":"text":"text"}function Gc(e,t){if(!e)return null;switch(PG(e,t)){case"bash":return Ol(e);case"xml":return MG(e);case"json":{const r=t?bv(t):{defaultLanguage:"json"};return Ev(e,r)}case"markdown":return FG(e);default:return e}}const BG=({code:e,toolName:t="",language:n,className:r=""})=>{const s=g.useMemo(()=>bv(t),[t]),i=n??s.defaultLanguage,o=g.useMemo(()=>i==="bash"?Ol(e):i==="diff"?yv(e):Ev(e,s),[e,i,s]);return a.jsx("div",{className:`font-mono text-[11px] select-text cursor-text ${r}`,children:o})},UG=({agentId:e,model:t="—",timestamp:n,tooltipId:r,freshInputTokens:s=0,cacheReadTokens:i=0,outputTokens:o=0,sessionId:l,className:u=""})=>{const[c,d]=g.useState(!1),p=g.useMemo(()=>`agent-badge-tt-${e}-${Math.random().toString(36).slice(2,7)}`,[e]),f=r||p,m=s+i+o;return a.jsxs("div",{className:`relative inline-flex items-center z-30 ${u}`,children:[a.jsx("button",{type:"button","aria-describedby":f,"aria-label":`Coding agent ${e} icon and metadata`,className:"p-1 rounded-md bg-base-300 border border-base-content/15 hover:border-primary text-base-content/80 hover:text-primary transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary shrink-0",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:b=>{b.key==="Escape"&&d(!1)},"data-testid":`agent-badge-${f}`,children:a.jsx(or,{id:e})}),c&&a.jsxs("div",{id:f,role:"tooltip","data-testid":f,className:"absolute left-0 top-full z-50 mt-1.5 w-64 p-3 rounded-xl bg-base-300 border border-base-content/20 shadow-2xl text-[11px] font-mono leading-relaxed pointer-events-none backdrop-blur-md flex flex-col gap-2.5 select-none",children:[a.jsx("div",{className:"flex items-center justify-between border-b border-base-content/10 pb-2",children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"p-1 rounded bg-base-200 text-primary shrink-0",children:a.jsx(or,{id:e})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-bold text-base-content uppercase tracking-wider text-[11px]",children:e}),a.jsx("div",{className:"text-[10px] text-base-content/60 truncate",title:t??"",children:t||"—"})]})]})}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-1 text-base-content/80 text-[10.5px]",children:[a.jsx("span",{className:"text-base-content/50",children:"Timestamp:"}),a.jsx("span",{className:"truncate",children:n?LG(n):"—"}),l&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-base-content/50",children:"Session:"}),a.jsx("span",{className:"truncate font-bold text-primary",title:l,children:l.length>16?`${l.slice(0,14)}…`:l})]})]}),a.jsxs("div",{className:"pt-2 border-t border-base-content/10 flex flex-col gap-1 text-[10.5px]",children:[a.jsx("div",{className:"font-bold text-base-content/70 text-[10px] uppercase tracking-wider",children:"Token Breakdown"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80",children:[a.jsx("span",{className:"text-base-content/50",children:"📥 Fresh input:"}),a.jsx("span",{children:xr(s)}),a.jsx("span",{className:"text-base-content/50",children:"💾 Cache read:"}),a.jsx("span",{className:"text-cyan-400",children:xr(i)}),a.jsx("span",{className:"text-base-content/50",children:"📤 Output:"}),a.jsx("span",{children:xr(o)}),a.jsx("span",{className:"text-base-content/50 border-t border-base-content/10 pt-0.5",children:"⚡ Total load:"}),a.jsx("span",{className:"font-bold border-t border-base-content/10 pt-0.5 text-primary",children:xr(m)})]})]})]})]})},rx=({item:e,categoryColor:t,label:n,badgePrefix:r,size:s="sm",className:i="",testId:o,tooltipId:l,onClick:u})=>{const[c,d]=g.useState(!1),[p,f]=g.useState(!1),[m,b]=g.useState(!1),[x,y]=g.useState(!1),E=g.useRef(null),v=e.category??xv(e.toolName),S=t??Dl[v]??Dl.other,A=e.seq??e.toolSeq??1,N=l||`tool-tooltip-${A}-${e.toolName}`,T=g.useMemo(()=>{if(!e.argsRaw)return null;try{const q=JSON.parse(e.argsRaw);return JSON.stringify(q,null,2)}catch{return e.argsRaw}},[e.argsRaw]),w=async q=>{if(q.stopPropagation(),!!T)try{await navigator.clipboard.writeText(T),b(!0),setTimeout(()=>b(!1),2e3)}catch{}},k=async q=>{if(q.stopPropagation(),!!e.errorText)try{await navigator.clipboard.writeText(e.errorText),y(!0),setTimeout(()=>y(!1),2e3)}catch{}},F=()=>{E.current&&(clearTimeout(E.current),E.current=null)},C=()=>{F(),d(!0)},$=()=>{p||(F(),E.current=setTimeout(()=>{d(!1)},150))},z=q=>{q.stopPropagation(),f(re=>!re),d(!0),u?.(q)},M=c||p,G=e.status==="error",H=s==="xs"?"px-1.5 py-0.2 text-[10px]":s==="md"?"px-2.5 py-1 text-xs":"px-2 py-0.5 text-[11px]",j=n??`${r??""}${e.toolName}`;return a.jsxs("div",{className:`relative inline-flex items-center ${i}`,children:[a.jsx("button",{type:"button","aria-describedby":N,className:`${H} rounded-md font-mono font-bold text-white shrink-0 tracking-wide cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary shadow-xs transition-opacity hover:opacity-90`,style:{backgroundColor:S},onClick:z,onMouseEnter:C,onMouseLeave:$,onFocus:()=>{F(),d(!0)},onBlur:()=>{p||d(!1)},onKeyDown:q=>{q.key==="Escape"&&(f(!1),d(!1))},"data-testid":o??`tool-tag-${A}`,children:j}),a.jsxs("div",{id:N,role:"tooltip","data-testid":l??`tool-tooltip-${A}`,"data-inspector-tooltip":"true",className:`absolute left-0 top-full mt-2 z-50 w-[880px] max-w-[95vw] bg-base-300 border border-base-content/20 shadow-2xl rounded-xl p-4 text-xs font-mono text-base-content backdrop-blur-md flex flex-col gap-3 pointer-events-auto select-text cursor-default ${M?"block":"hidden"}`,onMouseEnter:()=>{F(),d(!0)},onMouseLeave:$,onClick:q=>q.stopPropagation(),onKeyDown:q=>{q.key==="Escape"&&(f(!1),d(!1)),q.stopPropagation()},children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-base-content/10 pb-2.5",children:[a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsx("span",{className:"px-2.5 py-0.5 rounded-md text-xs font-bold text-white shrink-0 tracking-wide",style:{backgroundColor:S},children:e.toolName}),a.jsxs("span",{className:"text-xs text-base-content/50 font-bold",children:["#",A]}),a.jsxs("span",{className:"text-[11px] text-base-content/60 uppercase tracking-wider",children:["(",v,")"]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider ${G?"bg-error/20 text-error":"bg-success/20 text-success"}`,children:e.status??"ok"}),p&&a.jsx("button",{type:"button",className:"text-base-content/50 hover:text-base-content text-xs p-1 leading-none rounded hover:bg-base-content/10 cursor-pointer",onClick:q=>{q.stopPropagation(),f(!1),d(!1)},title:"Close tooltip",children:"✕"})]})]}),e.errorText&&a.jsxs("div",{className:"bg-error/10 text-error border border-error/20 rounded-lg p-2.5 text-xs",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"font-bold",children:"Execution Error:"}),a.jsx("button",{type:"button",className:"px-1.5 py-0.5 rounded text-[10px] bg-error/20 hover:bg-error/30 transition-colors cursor-pointer",onClick:k,children:x?"✓ Copied":"Copy"})]}),a.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap max-h-36 overflow-y-auto",children:e.errorText})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-[11px] font-semibold text-base-content/70",children:["Arguments (raw)"," ",a.jsx("span",{className:"text-base-content/40 font-normal",children:"(syntax-highlighted)"})]}),T&&a.jsx("button",{type:"button",className:"px-2 py-0.5 rounded text-[10px] font-mono text-base-content/70 hover:text-base-content hover:bg-base-content/10 transition-colors cursor-pointer border border-base-content/10",onClick:w,children:m?"✓ Copied":"Copy"})]}),T?a.jsx("div",{className:"bg-base-100 p-3 rounded-lg text-[11px] font-mono overflow-x-auto max-h-60 border border-base-content/10 whitespace-pre-wrap break-all text-base-content/90 overflow-y-auto",children:a.jsx(BG,{code:T,toolName:e.toolName})}):a.jsxs("div",{className:"p-2.5 bg-base-100/50 rounded-lg text-xs text-base-content/50 italic border border-base-content/10",children:["Raw payload omitted at import; digest available: ",e.argsDigest??"—"]}),e.argsDigest&&e.argsDigest!==e.argsRaw&&a.jsxs("div",{className:"text-[10px] text-base-content/50 truncate mt-0.5",children:[a.jsx("span",{className:"font-semibold",children:"Digest: "}),e.argsDigest]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-xs font-mono bg-base-200/70 p-2.5 rounded-lg border border-base-content/10",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"DURATION"}),a.jsx("span",{className:"text-[11px]",children:e.durationMs!==null&&e.durationMs!==void 0?`${e.durationMs} ms (${e.durationSource??"measured"})`:`— (${e.durationSource??"unmeasured"})`})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"TIMESTAMP"}),a.jsx("span",{className:"text-[11px] truncate block",children:e.ts??"—"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"SOURCE / MODEL"}),a.jsxs("span",{className:"text-[11px] truncate block",title:`${e.source??"—"} / ${e.model??"—"}`,children:[e.source??"—"," / ",e.model??"—"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"SESSION ID"}),a.jsx("span",{className:"text-[11px] truncate block",title:e.sessionId??"—",children:e.sessionId??"—"})]}),e.callId&&a.jsxs("div",{className:"col-span-2 md:col-span-4",children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"CALL ID"}),a.jsx("span",{className:"text-[11px] truncate block",title:e.callId,children:e.callId})]}),e.tokens&&a.jsxs("div",{className:"col-span-2 md:col-span-4 pt-1 border-t border-base-content/10",children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"TOKEN LOAD (SHARE)"}),a.jsxs("span",{className:"text-[11px]",children:["Billed: ",xr(e.tokens.billedTokens)," (Fresh:"," ",xr(e.tokens.freshInputTokens),", Cache:"," ",xr(e.tokens.cacheReadTokens),", Output:"," ",xr(e.tokens.outputTokens),")"]})]})]})]})]})},$G=rx,zG=({calls:e,fromSeq:t=1,toSeq:n=1,toolName:r,sessionId:s,maxVisible:i=12,className:o=""})=>{const[l,u]=g.useState(!1),c=g.useMemo(()=>{if(e&&e.length>0)return e;const f=[],m=Math.max(1,n-t+1);for(let b=0;b<m;b++)f.push({seq:t+b,toolSeq:t+b,toolName:r,sessionId:s,category:xv(r),status:"ok"});return f},[e,t,n,r,s]),d=l?c:c.slice(0,i),p=c.length-d.length;return a.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 ${o}`,children:[d.map(f=>a.jsx(rx,{item:f,label:`#${f.seq}`,size:"xs"},`${f.sessionId}-${f.seq}-${f.callId??""}`)),p>0&&a.jsxs("button",{type:"button",className:"px-2 py-0.5 rounded text-[10px] font-mono font-bold bg-base-content/10 text-base-content/70 hover:bg-base-content/20 transition-colors cursor-pointer",onClick:()=>u(!0),children:["+",p," more"]}),l&&c.length>i&&a.jsx("button",{type:"button",className:"px-2 py-0.5 rounded text-[10px] font-mono font-bold bg-base-content/10 text-base-content/70 hover:bg-base-content/20 transition-colors cursor-pointer",onClick:()=>u(!1),children:"Show less"})]})};function jE(e){const t=e.toLowerCase();return t.includes("read")||t.includes("view")||t.includes("cat")?"read":t.includes("write")||t.includes("edit")||t.includes("replace")||t.includes("patch")?"write":t.includes("bash")||t.includes("command")||t.includes("exec")||t.includes("terminal")?"bash":t.includes("grep")||t.includes("find")||t.includes("search")||t.includes("glob")?"search":t.includes("mcp")?"mcp":"other"}const Sv=({data:e,loading:t,error:n,cacheHitTrend:r,onSelectSession:s})=>{const[i,o]=g.useState("model"),[l,u]=g.useState("asc"),c=g.useMemo(()=>({"claude-opus-4.6":"#3987e5","claude-sonnet-4.6":"#199e70","gpt-5.6-sol":"#9085e9","grok-4.6":"#d95926",other:"#898781"}),[]),d=g.useMemo(()=>["Speed","Cache Ratio","Reliability","Output Ratio"],[]);if(t)return a.jsxs("div",{className:"flex flex-col items-center justify-center p-20 gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-full border-3 border-primary border-t-transparent animate-spin"}),a.jsx("span",{className:"text-xs font-mono text-base-content/60",children:"Analyzing operational insights..."})]});if(n)return a.jsxs("div",{className:"p-5 rounded-xl bg-error/10 border border-error/20 text-error flex items-center gap-3",children:[a.jsx("span",{className:"text-lg",children:"⚠️"}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-sm",children:"Failed to load insights"}),a.jsx("p",{className:"text-xs opacity-80",children:n})]})]});if(!e)return null;const{loops:p,cacheWaste:f,heavySessions:m,largestTokenSteps:b,slowSteps:x,modelComparison:y}=e,E=j=>{i===j?u(q=>q==="asc"?"desc":"asc"):(o(j),u(j==="model"?"asc":"desc"))},v=[...y].sort((j,q)=>{const re=l==="asc"?1:-1;return i==="model"?re*j.model.localeCompare(q.model):re*((j[i]??0)-(q[i]??0))}),S=j=>i!==j?a.jsx("span",{className:"opacity-30 ml-1 text-[10px]",children:"↕"}):a.jsx("span",{className:"text-primary ml-1 text-[10px]",children:l==="asc"?"▲":"▼"}),A=Math.max(1,...m.map(j=>j.tokens)),N=Math.max(1,...x.map(j=>j.durationMs??0)),T=p.reduce((j,q)=>j+(q.wastedTokens??0),0),w=f.reduce((j,q)=>j+(q.freshTokens??0),0),k=x[0],F=b[0],C=y.map(j=>j.speedMsMean),$=C.length>0?Math.min(...C):0,z=C.length>0?Math.max(...C):0,M=j=>z===$?100:Math.max(0,Math.min(100,Math.round((z-j)/(z-$)*100))),G=j=>Math.max(0,Math.min(100,Math.round(j*100))),H=y.map(j=>{const q=M(j.speedMsMean),re=G(j.cacheRatio),pe=G(j.reliability),I=G(j.outputRatio*5);return{label:j.model,color:c[j.model]??"#3987e5",values:[q,re,pe,I]}});return a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:`rounded-xl p-4 border flex flex-col justify-between transition-all ${p.length>0?"bg-warning/10 border-warning/30 text-warning":"bg-base-200 border-base-content/10"}`,children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Loop Anomalies"}),a.jsx("span",{children:p.length>0?"⚠️":"✓"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsxs("div",{className:"text-xl font-bold font-mono",children:[p.length," ",p.length===1?"incident":"incidents"]}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:p.length>0?`${Ce(T)} wasted tokens`:"Clean execution"})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Cache Waste"}),a.jsx("span",{className:"text-cyan-400",children:"⚡"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-error",children:Ce(w)}),a.jsxs("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:["Across ",f.length," un-cached steps"]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Peak Step Tokens"}),a.jsx("span",{className:"text-primary",children:"📊"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-primary",children:F?Ce(F.tokens):"—"}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5 truncate",children:F?`${F.toolName} (#${F.stepIndex})`:"No outlier steps"})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Peak Latency"}),a.jsx("span",{className:"text-amber-400",children:"⏱️"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-amber-400",children:k?.durationMs?Hs(k.durationMs):"—"}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5 truncate",children:k?`${k.toolName} (#${k.stepIndex})`:"No slow steps"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5 flex flex-col justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Top Cache-Wasting Incidents"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[f.length," incidents"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Steps that re-sent full context without cache hits"}),a.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 items-start",children:[(r?.length??0)>1&&a.jsxs("div",{"data-testid":"cache-hit-trend-chart",className:"p-3 bg-base-300/40 rounded-xl border border-base-content/5",children:[a.jsx("div",{className:"text-[10px] font-mono text-base-content/60 uppercase tracking-wider mb-2",children:"Cache Hit Ratio Trend"}),a.jsx(CG,{points:(r??[]).map(j=>({id:j.day,label:j.day.slice(5),v:j.cacheHitRatio})),color:"#22d3ee",height:130})]}),a.jsx("div",{className:"overflow-x-auto w-full",children:f.length>0?a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Session"}),a.jsx("th",{className:"py-1.5 text-right",children:"Fresh Tokens"}),a.jsx("th",{className:"py-1.5 pl-3",children:"Cause"})]})}),a.jsx("tbody",{children:f.map(j=>a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30 transition-colors",children:[a.jsx("td",{className:"py-1.5",children:a.jsxs("button",{type:"button",className:"text-primary hover:underline font-mono inline-flex items-center gap-1 cursor-pointer",onClick:()=>s?.(j.sessionId),title:`Jump to session ${j.sessionId}`,children:[a.jsx("span",{children:j.sessionId}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]})}),a.jsx("td",{className:"py-1.5 text-right text-error font-bold whitespace-nowrap",children:Ce(j.freshTokens)}),a.jsx("td",{className:"py-1.5 pl-3 text-base-content/70 truncate max-w-[140px]",title:j.reason,children:j.reason})]},`${j.sessionId}-${j.freshTokens}-${j.timestamp}`))})]}):a.jsx("div",{className:"p-6 text-center text-xs font-mono text-base-content/50",children:"✓ No cache-wasting incidents detected"})})]})]})}),a.jsx("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5 flex flex-col justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Heaviest Token Sessions"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[m.length," sessions"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Sessions consuming highest billed volume"}),a.jsx("div",{className:"flex flex-col gap-3",children:m.length>0?m.map(j=>a.jsxs("div",{className:"p-3 bg-base-300/40 rounded-xl border border-base-content/5 flex flex-col gap-1.5 hover:bg-base-300/70 transition-colors",children:[a.jsxs("div",{className:"flex justify-between items-center text-xs font-mono",children:[a.jsxs("button",{type:"button",className:"text-primary hover:underline font-bold inline-flex items-center gap-1.5 cursor-pointer text-left",onClick:()=>s?.(j.id,j.source),title:`Jump to session ${j.id}`,children:[a.jsx("span",{children:j.id}),a.jsxs("span",{className:"text-[10px] font-normal px-1.5 py-0.2 rounded bg-base-content/10 text-base-content/70",children:[j.source," · ",j.model]}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]}),a.jsx("span",{className:"font-bold",children:Ce(j.tokens)})]}),a.jsx(fi,{value:j.tokens,max:A,color:"#3987e5",height:6})]},j.id)):a.jsx("div",{className:"p-8 text-center text-xs font-mono text-base-content/50",children:"No heavy sessions recorded in this timeframe"})})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Top Time-Consuming Steps"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[x.length," steps"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Longest tool execution durations"}),a.jsx("div",{className:"overflow-x-auto",children:x.length>0?a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Tool / Step"}),a.jsx("th",{className:"py-1.5",children:"Session"}),a.jsx("th",{className:"py-1.5 text-right",children:"Duration"}),a.jsx("th",{className:"py-1.5 text-right",children:"Tokens"})]})}),a.jsx("tbody",{children:x.map(j=>{const q=jE(j.toolName),re=Gs[q]??Gs.other;return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30 transition-colors",children:[a.jsxs("td",{className:"py-1.5 font-bold",children:[a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[11px] border gap-1 mr-1.5 ${re}`,children:j.toolName}),a.jsxs("span",{className:"text-[10px] text-base-content/50",children:["#",j.stepIndex]})]}),a.jsx("td",{className:"py-1.5",children:a.jsxs("button",{type:"button",className:"text-primary hover:underline inline-flex items-center gap-1 cursor-pointer",onClick:()=>s?.(j.sessionId,j.agent),title:`Jump to session ${j.sessionId}`,children:[a.jsx("span",{children:j.sessionId}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]})}),a.jsx("td",{className:"py-1.5 text-right text-amber-400 font-bold w-24",children:a.jsxs("div",{className:"flex flex-col items-end gap-1",children:[a.jsx("span",{children:Hs(j.durationMs??0)}),a.jsx(fi,{value:j.durationMs??0,max:N,color:"#fbbf24",height:4})]})}),a.jsx("td",{className:"py-1.5 text-right tabular-nums",children:Ce(j.tokens)})]},`${j.sessionId}-${j.toolName}-${j.stepIndex}`)})})]}):a.jsx("div",{className:"p-8 text-center text-xs font-mono text-base-content/50",children:"No slow steps recorded"})})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Largest Token Steps"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[b.length," steps"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Single tool calls with highest token load"}),a.jsx("div",{className:"overflow-x-auto",children:b.length>0?a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Tool / Step"}),a.jsx("th",{className:"py-1.5",children:"Session"}),a.jsx("th",{className:"py-1.5",children:"Agent / Model"}),a.jsx("th",{className:"py-1.5 text-right",children:"Tokens"})]})}),a.jsx("tbody",{children:b.map(j=>{const q=jE(j.toolName),re=Gs[q]??Gs.other;return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30 transition-colors",children:[a.jsxs("td",{className:"py-1.5 font-bold",children:[a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[11px] border gap-1 mr-1.5 ${re}`,children:j.toolName}),a.jsxs("span",{className:"text-[10px] text-base-content/50",children:["#",j.stepIndex]})]}),a.jsx("td",{className:"py-1.5",children:a.jsxs("button",{type:"button",className:"text-primary hover:underline inline-flex items-center gap-1 cursor-pointer",onClick:()=>s?.(j.sessionId,j.agent),title:`Jump to session ${j.sessionId}`,children:[a.jsx("span",{children:j.sessionId}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]})}),a.jsx("td",{className:"py-1.5 text-xs text-base-content/70",children:a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-base-300 text-[11px]",children:[j.agent," · ",j.model]})}),a.jsx("td",{className:"py-1.5 text-right text-primary font-bold tabular-nums",children:Ce(j.tokens)})]},`${j.sessionId}-${j.toolName}-${j.stepIndex}`)})})]}):a.jsx("div",{className:"p-8 text-center text-xs font-mono text-base-content/50",children:"No large token step outliers found"})})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Model Multi-Axis Comparison"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[y.length," models evaluated"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-4",children:"Evaluation across Speed, Cache ratio, Reliability, and Output ratio"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-center",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center p-3 bg-base-300/30 rounded-xl border border-base-content/5",children:[a.jsx(IG,{axes:d,series:H,height:280}),a.jsx("div",{className:"flex flex-wrap items-center justify-center gap-3 mt-3",children:H.map(j=>a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-mono text-base-content/80 px-2 py-0.5 rounded-full bg-base-300 border border-base-content/10",children:[a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:j.color}}),j.label]},j.label))})]}),a.jsx("div",{className:"overflow-x-auto w-full",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsxs("th",{className:"py-2 cursor-pointer select-none hover:text-base-content",onClick:()=>E("model"),children:["Model ",S("model")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("speedMsMean"),children:["Mean Speed (ms) ",S("speedMsMean")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("cacheRatio"),children:["Cache Ratio ",S("cacheRatio")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("reliability"),children:["Reliability ",S("reliability")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("outputRatio"),children:["Output Ratio ",S("outputRatio")]})]})}),a.jsx("tbody",{children:v.map(j=>a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/40 transition-colors",children:[a.jsxs("td",{className:"py-2 font-bold flex items-center gap-2",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0 shadow-xs",style:{background:c[j.model]??"#3987e5"}}),a.jsx("span",{className:"truncate",children:j.model})]}),a.jsx("td",{className:"py-2 text-right font-mono tabular-nums",children:Ct(j.speedMsMean)}),a.jsx("td",{className:"py-2 text-right font-mono tabular-nums text-cyan-400 font-bold",children:Wn(j.cacheRatio*100)}),a.jsx("td",{className:`py-2 text-right font-mono tabular-nums font-bold ${j.reliability>=.95?"text-emerald-400":j.reliability>=.8?"text-amber-400":"text-error"}`,children:Wn(j.reliability*100)}),a.jsx("td",{className:"py-2 text-right font-mono tabular-nums text-base-content/80",children:Wn(j.outputRatio*100)})]},j.model))})]})})]})]}),p.length>0&&a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-warning/30 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-warning text-lg",children:"⚠️"}),a.jsx("h3",{className:"font-bold text-base",children:"Detected Execution Loops (Repeats ≥ 3)"})]}),a.jsxs("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-warning/20 text-warning border border-warning/30",children:[p.length," loop ",p.length===1?"pattern":"patterns"," detected"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-4",children:"Identified consecutive identical tool invocations without intervening state changes. Hover or click on any invocation badge to inspect full arguments, duration, and diagnostics."}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:p.map(j=>a.jsxs("div",{className:"p-4 bg-base-300/70 rounded-xl border border-base-content/10 flex flex-col justify-between gap-3 shadow-xs hover:border-warning/40 transition-colors",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-warning/20 text-warning border border-warning/30",children:[j.tool," × ",j.repeats," repeats"]}),a.jsxs("button",{type:"button",className:"text-xs font-mono text-primary hover:underline cursor-pointer inline-flex items-center gap-1 font-bold",onClick:()=>s?.(j.sessionId),title:"Jump to session in Tool Using & Timeline",children:[j.sessionId," →"]})]}),a.jsxs("div",{className:"font-mono text-xs text-base-content/80 mt-2 p-2 bg-base-200/80 rounded-lg border border-base-content/5 truncate",title:j.argsHint,children:[a.jsx("span",{className:"text-[10px] text-base-content/50 block mb-0.5 uppercase tracking-wider",children:"Argument signature"}),j.argsHint==="74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b"?"empty/unrecorded arguments":j.argsHint]}),a.jsxs("div",{className:"text-[11px] font-mono text-base-content/60 mt-2",children:["Step sequence: #",j.fromSeq," → #",j.toSeq]}),a.jsxs("div",{className:"mt-3 pt-2.5 border-t border-base-content/10",children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50 mb-1.5",children:"Repeated Invocations (hover/click for details):"}),a.jsx(zG,{calls:j.repeatedCalls,fromSeq:j.fromSeq,toSeq:j.toSeq,toolName:j.tool,sessionId:j.sessionId})]})]}),a.jsxs("div",{className:"flex justify-between items-center text-xs font-mono pt-2 border-t border-base-content/10 bg-base-200/40 -mx-4 -mb-4 p-3 rounded-b-xl",children:[a.jsx("span",{className:"text-base-content/60",children:"Estimated Wasted Tokens:"}),a.jsx("span",{className:"text-error font-bold text-sm",children:Ce(j.wastedTokens)})]})]},`${j.tool}-${j.sessionId}-${j.fromSeq}`))})]})]})};function HG(e){const t=e.toLowerCase();return t.includes("read")||t.includes("view")||t.includes("cat")?"read":t.includes("write")||t.includes("edit")||t.includes("replace")||t.includes("patch")?"write":t.includes("bash")||t.includes("command")||t.includes("exec")||t.includes("terminal")?"bash":t.includes("grep")||t.includes("find")||t.includes("search")||t.includes("glob")?"search":t.includes("mcp")?"mcp":"other"}const Tv=({data:e,loading:t,error:n,sortBy:r="start",sortDir:s="desc",page:i=1,pageSize:o=20,onSortChange:l,onPageChange:u,onSelectSession:c})=>{const[d,p]=g.useState(""),[f,m]=g.useState("all");if(t)return a.jsxs("div",{className:"flex flex-col items-center justify-center p-20 gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-full border-3 border-primary border-t-transparent animate-spin"}),a.jsx("span",{className:"text-xs font-mono text-base-content/60",children:"Loading session records..."})]});if(n)return a.jsxs("div",{className:"p-5 rounded-xl bg-error/10 border border-error/20 text-error flex items-center gap-3",children:[a.jsx("span",{className:"text-lg",children:"⚠️"}),a.jsxs("div",{children:[a.jsxs("h5",{className:"font-bold text-sm",children:["Failed to load sessions: ",n]}),a.jsx("p",{className:"text-xs opacity-80",children:"Please check your connection and try refreshing."})]})]});if(!e)return null;const{items:b,total:x}=e,y=Math.max(1,Math.ceil(x/o)),E=b.reduce((w,k)=>w+k.billedTokens,0),v=b.reduce((w,k)=>w+k.cacheReadTokens,0),S=b.filter(w=>w.state==="error").length,A=Math.max(1,...b.map(w=>w.billedTokens)),N=b.filter(w=>{if(f!=="all"&&w.state!==f)return!1;if(!d.trim())return!0;const k=d.toLowerCase();return w.id.toLowerCase().includes(k)||w.source.toLowerCase().includes(k)||w.model.toLowerCase().includes(k)||w.topTool.toLowerCase().includes(k)}),T=w=>r!==w?a.jsx("span",{className:"opacity-25 ml-1 text-[10px]",children:"↕"}):a.jsx("span",{className:"ml-1 text-primary font-bold",children:s==="asc"?"▲":"▼"});return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Total Sessions"}),a.jsx("span",{className:"text-primary",children:"📋"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-base-content",children:Ct(x)}),a.jsxs("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:["Showing page ",i," of ",y]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Page Billed Tokens"}),a.jsx("span",{className:"text-primary",children:"⚡"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-primary",children:Ce(E)}),a.jsxs("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:["Across ",b.length," page sessions"]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Page Cache Read"}),a.jsx("span",{className:"text-cyan-400",children:"💾"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-cyan-400",children:Ce(v)}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:"Reused context tokens"})]})]}),a.jsxs("div",{className:`rounded-xl p-4 border flex flex-col justify-between transition-all ${S>0?"bg-error/10 border-error/30 text-error":"bg-base-200 border-base-content/10"}`,children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Session Status"}),a.jsx("span",{children:S>0?"⚠️":"✓"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsxs("div",{className:"text-xl font-bold font-mono",children:[b.length-S," OK · ",S," Error"]}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:S===0?"100% successful on page":`${S} failed sessions`})]})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 bg-base-200 p-3 rounded-xl border border-base-content/10",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[200px]",children:[a.jsx("span",{className:"text-base-content/40 text-xs",children:"🔍"}),a.jsx("input",{type:"text",placeholder:"Filter sessions by ID, model, agent, or tool...",value:d,onChange:w=>p(w.target.value),className:"bg-base-300/60 text-xs font-mono px-3 py-1.5 rounded-lg border border-base-content/10 w-full focus:outline-hidden focus:border-primary placeholder:text-base-content/40"}),d&&a.jsx("button",{type:"button",onClick:()=>p(""),className:"text-xs text-base-content/50 hover:text-base-content cursor-pointer",children:"✕"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-mono",children:[a.jsx("span",{className:"text-base-content/50 text-[11px] uppercase tracking-wider mr-1",children:"State:"}),["all","ok","error"].map(w=>a.jsx("button",{type:"button",onClick:()=>m(w),className:`px-2.5 py-1 rounded-md text-xs uppercase font-bold transition-colors cursor-pointer ${f===w?"bg-primary text-primary-content shadow-xs":"bg-base-300 text-base-content/70 hover:bg-base-300/80"}`,children:w},w))]})]}),a.jsx("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-base-300/80 text-base-content/70 border-b border-base-content/10 select-none",children:[a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Session ID"}),a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Agent"}),a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Model"}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors whitespace-nowrap",onClick:()=>l?.("start"),children:["Start Time ",T("start")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("duration"),children:["Duration ",T("duration")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("messages"),children:["Msgs ",T("messages")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("toolCalls"),children:["Tools ",T("toolCalls")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("billedTokens"),children:["Billed Tok ",T("billedTokens")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("cacheRead"),children:["Cache Read ",T("cacheRead")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("freshInput"),children:["Fresh Input ",T("freshInput")]}),a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Top Tool"}),a.jsx("th",{className:"p-3 text-center whitespace-nowrap",children:"State"})]})}),a.jsx("tbody",{children:N.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:12,className:"text-center py-12 text-base-content/50",children:"No sessions matching the current filter."})}):N.map(w=>{const k=HG(w.topTool),F=Gs[k]??Gs.other,C=Math.min(100,Math.round(w.billedTokens/A*100));return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-primary/10 cursor-pointer transition-colors group",onClick:()=>c?.(w.source,w.id),title:"Click to view execution timeline",children:[a.jsx("td",{className:"p-3 font-bold text-primary whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"font-mono text-xs",title:w.id,children:w.id.length>18?`${w.id.slice(0,16)}…`:w.id}),a.jsx("span",{className:"text-[10px] opacity-40 group-hover:opacity-100 transition-opacity",children:"↗"})]})}),a.jsx("td",{className:"p-3 whitespace-nowrap",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] bg-base-300 border border-base-content/10 font-mono text-base-content",children:[a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center opacity-80",children:a.jsx(or,{id:w.source})}),a.jsx("span",{children:w.source})]})}),a.jsx("td",{className:"p-3 text-base-content/80 whitespace-nowrap",children:a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-base-300/60 border border-base-content/5 text-[11px]",children:w.model})}),a.jsx("td",{className:"p-3 font-mono text-xs text-base-content/70 whitespace-nowrap",children:_G(w.start)}),a.jsx("td",{className:"p-3 text-right font-semibold tabular-nums whitespace-nowrap",children:fv(w.durationMs/6e4)}),a.jsx("td",{className:"p-3 text-right tabular-nums text-base-content/80 whitespace-nowrap",children:Ct(w.messages)}),a.jsx("td",{className:"p-3 text-right tabular-nums text-base-content/80 whitespace-nowrap",children:Ct(w.toolCalls)}),a.jsx("td",{className:"p-3 text-right font-bold text-primary tabular-nums whitespace-nowrap",children:a.jsxs("div",{className:"flex flex-col items-end gap-0.5",children:[a.jsx("span",{children:Ce(w.billedTokens)}),a.jsx("div",{className:"w-12 bg-base-300 h-1 rounded-full overflow-hidden",children:a.jsx("div",{className:"bg-primary h-full rounded-full",style:{width:`${C}%`}})})]})}),a.jsx("td",{className:"p-3 text-right text-cyan-400 font-bold tabular-nums whitespace-nowrap",children:Ce(w.cacheReadTokens)}),a.jsx("td",{className:"p-3 text-right text-base-content/70 tabular-nums whitespace-nowrap",children:Ce(w.freshInputTokens)}),a.jsx("td",{className:"p-3 whitespace-nowrap",children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] border font-mono ${F}`,children:w.topTool})}),a.jsx("td",{className:"p-3 text-center whitespace-nowrap",children:a.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-mono font-bold border ${w.state==="error"?"bg-error/15 text-error border-error/30":w.state==="running"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/30 animate-pulse":"bg-emerald-500/15 text-emerald-400 border-emerald-500/30"}`,children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current"}),w.state]})})]},`${w.source}:::${w.id}`)})})]})})}),a.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-3 px-2 py-1 text-xs",children:[a.jsxs("span",{className:"text-base-content/70 font-mono text-[11px]",children:["Showing ",(i-1)*o+1,"–",Math.min(i*o,x)," of ",x," sessions"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded-lg border border-base-content/20 hover:bg-base-content/10 font-medium disabled:opacity-40 disabled:hover:bg-transparent cursor-pointer transition-colors",disabled:i<=1,onClick:()=>u?.(i-1),children:"« Previous"}),a.jsxs("span",{className:"px-3 py-1.5 text-xs font-mono bg-base-300 rounded-lg border border-base-content/10 text-base-content font-bold",children:[i," / ",y]}),a.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded-lg border border-base-content/20 hover:bg-base-content/10 font-medium disabled:opacity-40 disabled:hover:bg-transparent cursor-pointer transition-colors",disabled:i>=y,onClick:()=>u?.(i+1),children:"Next »"})]})]})]})},Nv=({data:e,loading:t,error:n,onTriggerImport:r})=>{const[s,i]=g.useState(!1),[o,l]=g.useState(null),u=async()=>{i(!0),l("Running import & analytics rollup...");try{const m=await r?.("incremental");l(m?.message??"Import queued.")}catch(m){l(`Import failed: ${m instanceof Error?m.message:String(m)}`)}finally{i(!1)}};if(t)return a.jsx("div",{className:"flex items-center justify-center p-16",children:a.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-primary border-t-transparent animate-spin"})});if(n)return a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error",children:a.jsxs("span",{children:["Failed to load sources registry: ",n]})});if(!e)return null;const{overview:c,agents:d,roots:p}=e,f=d[0]?.heatmapDays.length;return a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xl",children:"🗄️"}),a.jsx("h3",{className:"font-bold text-base",children:"Transcripts Corpus & Ingestion Registry"})]}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-xs font-mono text-base-content/70 mt-1",children:[a.jsxs("span",{children:["Files: ",a.jsx("strong",{className:"text-base-content",children:Ct(c.totalFiles)})]}),a.jsxs("span",{children:["Corpus Size:"," ",a.jsxs("strong",{className:"text-base-content",children:[(c.corpusSizeBytes/(1024*1024)).toFixed(1)," MB"]})]}),a.jsxs("span",{children:["Total Sessions:"," ",a.jsx("strong",{className:"text-base-content",children:Ct(c.totalSessions)})]}),a.jsxs("span",{children:["Coverage:"," ",a.jsxs("strong",{className:"text-base-content",children:[c.dateCoverage.from?.slice(0,10)??"N/A"," →"," ",c.dateCoverage.to?.slice(0,10)??"N/A"]})]}),a.jsxs("span",{children:["Last Import:"," ",a.jsx("strong",{className:"text-base-content",children:c.lastImportedAt?new Date(c.lastImportedAt).toLocaleString():"never imported"})]})]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[a.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-primary text-primary-content font-medium text-xs hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:s,onClick:u,children:s?"Importing...":"🔄 Import & Analyze"}),o&&a.jsx("span",{className:"text-[11px] font-mono text-info","aria-live":"polite",children:o})]})]}),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-bold text-sm mb-3",children:["Agent Activity (",f??"—","-Day Daily Heatmaps)"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:d.map(m=>a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 hover:border-base-content/30 transition-all p-4 flex flex-col justify-between gap-3",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsxs("div",{className:"relative group",children:[a.jsx("button",{type:"button",className:"w-7 h-7 rounded-lg flex items-center justify-center text-white shadow-xs focus:outline-2 focus:outline-offset-2 focus:outline-primary",style:{background:m.color},"aria-label":`${m.name} source metrics`,"aria-describedby":`source-tooltip-${m.id}`,children:a.jsx(or,{id:m.id})}),a.jsxs("div",{id:`source-tooltip-${m.id}`,role:"tooltip",className:"pointer-events-none absolute z-20 left-0 top-9 w-64 rounded-lg border border-base-content/15 bg-base-100 p-3 text-[11px] font-mono shadow-xl opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:[a.jsxs("div",{className:"mb-2 font-bold text-sm",children:[m.name," Summary"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1",children:[a.jsx("span",{className:"text-base-content/60",children:"Imported Files"}),a.jsx("strong",{className:"text-right",children:Ct(m.filesCount)}),a.jsx("span",{className:"text-base-content/60",children:"Sessions"}),a.jsx("strong",{className:"text-right",children:Ct(m.sessionCount)}),a.jsx("span",{className:"text-base-content/60",children:"Total Tokens"}),a.jsx("strong",{className:"text-right",children:Ce(m.totalTokens)}),a.jsx("span",{className:"text-base-content/60",children:"Cache Saved"}),a.jsx("strong",{className:"text-right",children:Ce(m.cacheSavedTokens)}),a.jsx("span",{className:"text-base-content/60",children:"Tool Calls"}),a.jsx("strong",{className:"text-right",children:Ct(m.toolCalls)}),a.jsx("span",{className:"text-base-content/60",children:"Date Range"}),a.jsxs("strong",{className:"text-right",children:[m.firstDate?.slice(0,10)??"N/A"," →"," ",m.lastDate?.slice(0,10)??"N/A"]})]})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"font-bold text-sm",children:m.name}),a.jsx("div",{className:"text-[10px] font-mono text-base-content/60",children:m.importPath})]})]}),a.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-mono font-bold bg-base-300 border border-base-content/10 text-base-content",children:[Ce(m.totalTokens)," tok"]})]}),a.jsxs("div",{className:"bg-base-300/60 p-2 rounded-lg border border-base-content/5",children:[a.jsxs("div",{className:"text-[10px] font-mono text-base-content/50 mb-1 flex justify-between",children:[a.jsxs("span",{children:[f??"—"," days ago"]}),a.jsx("span",{children:"Today"})]}),a.jsx(DG,{days:m.heatmapDays,color:m.color,maxDailyTokens:m.maxDailyTokens})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-2 border-t border-base-content/10 font-mono text-[11px]",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"Sessions"}),a.jsx("span",{className:"font-semibold",children:Ct(m.sessionCount)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"Tool Calls"}),a.jsx("span",{className:"font-semibold",children:Ct(m.toolCalls)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"Cache Saved"}),a.jsx("span",{className:"font-semibold text-emerald-400",children:Ce(m.cacheSavedTokens)})]})]})]},m.id))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Source Directories & Import Roots"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Agent"}),a.jsx("th",{className:"py-1.5",children:"Filesystem Path"}),a.jsx("th",{className:"py-1.5",children:"Match Pattern"}),a.jsx("th",{className:"py-1.5 text-right",children:"Files Count"}),a.jsx("th",{className:"py-1.5 text-center",children:"Status"})]})}),a.jsx("tbody",{children:p.map(m=>a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30",children:[a.jsx("td",{className:"py-1.5 font-bold",children:m.agentName}),a.jsx("td",{className:"py-1.5 text-base-content/80",children:m.path}),a.jsx("td",{className:"py-1.5 text-base-content/60",children:m.matchPattern}),a.jsx("td",{className:"py-1.5 text-right font-semibold",children:Ct(m.fileCount)}),a.jsx("td",{className:"py-1.5 text-center",children:a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-emerald-500/20 text-emerald-400 uppercase font-bold",children:m.status})})]},m.agentId))})]})})]})]})},GG=["auto","1m","3m","5m","10m","30m","1h","4h","1d"],Yr=["#3987e5","#199e70","#d95926","#9085e9","#c98500","#ec4899","#8b5cf6","#06b6d4","#f59e0b","#10b981"],WG=(e,t)=>t===void 0||t===0?null:(e-t)/Math.abs(t)*100,Vd=g.memo(({current:e,previous:t,invert:n=!1})=>{const r=WG(e,t);if(r===null)return a.jsx("span",{className:"text-[10px] text-base-content/40",children:"No prior baseline"});const s=r>=0,i=n?!s:s;return a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold font-mono ${i?"bg-emerald-500/15 text-emerald-400":"bg-error/15 text-error"}`,children:[s?"↑ +":"↓ ",Math.abs(r).toFixed(1),"% vs previous period"]})}),$o=g.memo(({label:e,value:t,sub:n,trend:r,trendColor:s,current:i,previous:o,invert:l,badge:u})=>a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:e}),u]}),a.jsxs("div",{className:"flex items-end justify-between gap-2 mt-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold font-mono text-primary",children:t}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[a.jsx(Vd,{current:i,previous:o,invert:l}),a.jsx("span",{className:"text-xs text-base-content/60",children:n})]})]}),r.length>1&&a.jsx(gv,{values:r,color:s,width:100,height:34})]})]})),zo=g.memo(({title:e,description:t,series:n,buckets:r,chartMode:s,onToggleChartMode:i,testId:o})=>{const l=r.length>0&&n.length>0&&r.some(u=>Object.values(u.v).some(c=>c>0));return a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col gap-3 w-full","data-testid":o,children:[a.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-2 pb-2 border-b border-base-content/10",children:[a.jsx("div",{children:a.jsxs("h4",{className:"font-bold text-sm text-base-content flex items-center gap-2",children:[a.jsx(Br,{tip:t,position:"top",className:"cursor-help [&:before]:whitespace-normal [&:before]:max-w-xs [&:before]:text-left [&:before]:text-[11px] [&:before]:font-normal [&:before]:leading-snug z-20","data-testid":o?`${o}-tooltip`:void 0,children:a.jsx("span",{className:"hover:text-primary transition-colors",children:e})}),a.jsxs("span",{className:"text-[11px] font-normal text-base-content/60 font-mono",children:["(",n.length," tracked)"]})]})}),a.jsxs("div",{className:"flex items-center gap-1 bg-base-300 p-0.5 rounded-lg text-xs",children:[a.jsx("button",{type:"button","aria-pressed":s==="chart",className:`px-2.5 py-1 rounded text-[11px] font-medium transition-colors ${s==="chart"?"bg-base-100 text-base-content font-bold shadow-xs":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>s!=="chart"&&i(),children:"Chart"}),a.jsx("button",{type:"button","aria-pressed":s==="table",className:`px-2.5 py-1 rounded text-[11px] font-medium transition-colors ${s==="table"?"bg-base-100 text-base-content font-bold shadow-xs":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>s!=="table"&&i(),children:"Table"})]})]}),a.jsx("div",{className:"min-h-[220px]",children:s==="table"&&r.length>0&&n.length>0?a.jsx("div",{className:"overflow-x-auto max-h-72 overflow-y-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono","data-testid":"summary-bucket-table",children:[a.jsx("thead",{className:"sticky top-0 bg-base-200",children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5 pr-2",children:"Bucket"}),n.map(u=>a.jsx("th",{className:"py-1.5 pr-2 text-right",children:a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx("span",{className:"w-2 h-2 rounded-full inline-block shrink-0",style:{background:u.color}}),u.label]})},u.id)),a.jsx("th",{className:"py-1.5 pr-2 text-right",children:"Total"}),a.jsx("th",{className:"py-1.5 pr-2 text-right",children:"Cache Hit %"}),a.jsx("th",{className:"py-1.5 text-right",children:"Gain Ratio %"})]})}),a.jsx("tbody",{children:r.map(u=>{const c=Object.values(u.v).reduce((d,p)=>d+p,0);return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30",children:[a.jsx("td",{className:"py-1.5 pr-2 font-bold",children:mv(u.id??u.label)}),n.map(d=>a.jsx("td",{className:"py-1.5 pr-2 text-right tabular-nums",children:u.v[d.id]!==void 0?Ce(u.v[d.id]??0):"—"},d.id)),a.jsx("td",{className:"py-1.5 pr-2 text-right tabular-nums font-bold",children:Ce(c)}),a.jsx("td",{className:"py-1.5 pr-2 text-right tabular-nums text-cyan-400",children:u.lineValue!==void 0?`${u.lineValue.toFixed(1)}%`:"—"}),a.jsx("td",{className:"py-1.5 text-right tabular-nums text-amber-400",children:u.secondLineValue!==void 0?`${u.secondLineValue.toFixed(1)}%`:"—"})]},u.id??u.label)})})]})}):l?a.jsx(hv,{buckets:r,series:n,height:220}):r.length>0&&n.length>0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-[220px] text-base-content/50 text-xs font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30 text-center px-4 gap-1",children:[a.jsxs("span",{className:"font-semibold text-base-content/70",children:["No token or call activity recorded for ",e.toLowerCase()," in this time range."]}),a.jsx("span",{className:"text-[11px] text-base-content/40",children:"Activity is unmeasured or zero in this window. Adjust the time range filter or switch to Table view."})]}):a.jsx("div",{className:"flex flex-col items-center justify-center h-[220px] text-base-content/40 text-xs font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30",children:a.jsxs("span",{children:["No ",e.toLowerCase()," activity recorded for this time range."]})})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 pt-1.5 border-t border-base-content/5",children:[n.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(u=>a.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-base-300/80 border border-base-content/5 gap-1.5 font-mono text-[10px] text-base-content/80",children:[a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:u.color}}),a.jsx("span",{className:"truncate max-w-[150px]",children:u.label})]},u.id))}),a.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-mono text-base-content/70 ml-auto",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"w-3 h-0.5 bg-cyan-400 rounded-full inline-block"}),a.jsx("span",{className:"text-cyan-400",children:"Cache Hit %"})]}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"w-3 h-0.5 bg-amber-400 rounded-full inline-block"}),a.jsx("span",{className:"text-amber-400",children:"Gain Ratio %"})]})]})]})]})}),Ho=(e,t,n)=>{const r=new Map;e.forEach((i,o)=>{r.set(i.id,{id:i.id,label:i.label||i.id,color:i.color||n[o%n.length]||"#3987e5"})});let s=r.size;for(const i of t)for(const o of Object.keys(i.series))o&&!r.has(o)&&(r.set(o,{id:o,label:o,color:n[s%n.length]||"#3987e5"}),s++);return Array.from(r.values())},Go=e=>e.map(t=>({id:t.bucketStart,label:Rl(t.bucketStart),v:t.series,lineValue:t.cacheHitRatio,secondLineValue:t.gainRatio})),Wc=["#199e70","#3987e5","#d95926","#9085e9","#c98500","#ec4899","#8b5cf6","#06b6d4","#f59e0b","#10b981"],wv=g.memo(({data:e,loading:t,error:n,dimension:r="model",onDimensionChange:s,bucket:i="auto",onBucketChange:o,loopSummary:l})=>{const[u,c]=g.useState("chart"),[d,p]=g.useState({model:"chart",source:"chart",tool:"chart",skill:"chart"}),f=g.useCallback(()=>p(W=>({...W,model:W.model==="chart"?"table":"chart"})),[]),m=g.useCallback(()=>p(W=>({...W,source:W.source==="chart"?"table":"chart"})),[]),b=g.useCallback(()=>p(W=>({...W,tool:W.tool==="chart"?"table":"chart"})),[]),x=g.useCallback(()=>p(W=>({...W,skill:W.skill==="chart"?"table":"chart"})),[]),y=e?.kpis,E=e?.previousKpis,v=e?.kpiTrend??[],S=e?.timeSeries??[],A=e?.topModels??[],N=e?.topSources??[],T=e?.topTools??[],w=g.useMemo(()=>Math.max(0,...A.map(W=>W.tokens),...N.map(W=>W.tokens)),[A,N]),k=e?.skillsUsed??[],F=e?.skillTimeSeries??[],C=e?.skillBreakdown??{bySkill:[],bySource:[],byInvocationKind:[],trend:[],fresh:!0},$=e?.modelTimeSeries??[],z=e?.sourceTimeSeries??[],M=e?.toolTimeSeries??[],G=e?.cacheEfficiency??{savedTokens:0,hitRatio:0,totalRead:0,bySource:[],byModel:[],byAgentModel:[]},H=E??void 0,j=G.byAgentModel??[],q=g.useMemo(()=>Array.from(new Set(j.map(W=>W.model))),[j]),re=g.useMemo(()=>Array.from(new Set(j.map(W=>W.source))),[j]),pe=g.useMemo(()=>new Map(j.map(W=>[`${W.source}\0${W.model}`,W])),[j]),I=g.useMemo(()=>new Map(N.map(W=>[W.id,W.label])),[N]),Z=g.useMemo(()=>({billed:v.map(W=>W.totalBilledTokens),cacheSaved:v.map(W=>W.cacheSavedTokens),sessions:v.map(W=>W.sessionsCount),toolCalls:v.map(W=>W.toolCallsCount)}),[v]),ie=g.useMemo(()=>T.map(W=>({...W,id:W.id&&W.id.trim()!==""?W.id.trim():"unknown"})),[T]),L=g.useMemo(()=>k.filter(W=>W.id&&W.id.trim()!==""&&W.id!=="unknown"),[k]),Ee=g.useMemo(()=>$&&$.length>0?$:r==="model"?S:[],[$,r,S]),fe=g.useMemo(()=>z&&z.length>0?z:r==="source"?S:[],[z,r,S]),Y=g.useMemo(()=>M&&M.length>0?M:r==="tool"?S:[],[M,r,S]),me=g.useMemo(()=>F&&F.length>0?F:r==="skill"?S:[],[F,r,S]),te=g.useMemo(()=>Ho(A,Ee,Yr),[A,Ee]),O=g.useMemo(()=>Ho(N,fe,Yr),[N,fe]),he=g.useMemo(()=>Ho(ie.map((W,_e)=>({id:W.id,label:W.id,color:Wc[_e%Wc.length]})),Y,Wc),[ie,Y]),be=g.useMemo(()=>Ho(L,me,Yr),[L,me]),ye=g.useMemo(()=>Go(Ee),[Ee]),we=g.useMemo(()=>Go(fe),[fe]),Pe=g.useMemo(()=>Go(Y),[Y]),ue=g.useMemo(()=>Go(me),[me]),Ye=g.useMemo(()=>F.map(W=>({id:W.bucketStart,label:Rl(W.bucketStart),v:W.series})),[F]),at=g.useMemo(()=>C.trend.map(W=>({id:W.bucketStart,label:Rl(W.bucketStart),v:W.series})),[C.trend]),Qe=g.useMemo(()=>C.bySkill.map((W,_e)=>({id:W.skillName,label:W.skillName,color:Yr[_e%Yr.length]||"#3987e5"})),[C.bySkill]),{toolCallTotal:At,toolTimeTotal:ft,toolTokenTotal:dt,avgBilledPerSession:Ot,avgBilledPerCall:qe,prevAvgPerSession:De,prevAvgPerCall:Ke,freshInputTokens:Q,outputTokens:le,skillTokenTotals:Ae}=g.useMemo(()=>{const W=ie.reduce((ve,He)=>ve+He.count,0),_e=ie.reduce((ve,He)=>ve+(He.durationMs??0),0),Be=ie.reduce((ve,He)=>ve+(He.tokens??0),0),ut=y?.totalBilledTokens??0,mt=y?.sessionsCount??0,kt=y?.toolCallsCount??0,yt=mt>0?ut/mt:0,oe=kt>0?ut/kt:0,Ne=H&&H.sessionsCount>0?H.totalBilledTokens/H.sessionsCount:void 0,je=H&&H.toolCallsCount>0?H.totalBilledTokens/H.toolCallsCount:void 0,Ie=Math.max(0,G.totalRead-G.savedTokens),gt=Math.max(0,ut-Ie),Ft=F.reduce((ve,He)=>{for(const[$e,bt]of Object.entries(He.series))ve[$e]=(ve[$e]??0)+bt;return ve},{});return{toolCallTotal:W,toolTimeTotal:_e,toolTokenTotal:Be,avgBilledPerSession:yt,avgBilledPerCall:oe,prevAvgPerSession:Ne,prevAvgPerCall:je,freshInputTokens:Ie,outputTokens:gt,skillTokenTotals:Ft}},[ie,y,H,G,F]);return t?a.jsx("div",{className:"flex items-center justify-center p-16",children:a.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-primary border-t-transparent animate-spin"})}):n?a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error",children:a.jsxs("span",{children:["Failed to load history summary: ",n]})}):!e||!y?null:a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx($o,{label:"Total Billed Tokens",value:Ce(y.totalBilledTokens),sub:`Fresh ${Ce(Q)} · Output ${Ce(le)}`,trend:Z.billed,trendColor:"#3987e5",current:y.totalBilledTokens,previous:H?.totalBilledTokens}),a.jsx($o,{label:"Cache-Saved Tokens",value:Ce(y.cacheSavedTokens),sub:`Share ${Wn(y.cacheSavedPercent)} · Hit ${Wn(G.hitRatio)}`,trend:Z.cacheSaved,trendColor:"#22d3ee",current:y.cacheSavedTokens,previous:H?.cacheSavedTokens,badge:a.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30",children:[y.cacheSavedPercent,"% saved"]})}),a.jsx($o,{label:"Sessions",value:Ct(y.sessionsCount),sub:`${Ct(y.sessionsCount>0?y.toolCallsCount/y.sessionsCount:0)} calls / session`,trend:Z.sessions,trendColor:"#9085e9",current:y.sessionsCount,previous:H?.sessionsCount}),a.jsx($o,{label:"Tool Calls",value:Ct(y.toolCallsCount),sub:`${Ce(qe)} billed / step`,trend:Z.toolCalls,trendColor:"#c98500",current:y.toolCallsCount,previous:H?.toolCallsCount,badge:a.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-mono bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[Wn(y.errorRate)," err"]})})]}),a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-3",children:[a.jsx("div",{children:a.jsx("h3",{className:"font-bold text-base text-base-content",children:a.jsx(Br,{tip:"4-block breakdown across Model, Source, Tool, and Skill (Stacked token bars with Cache Hit % and Gain Ratio % line overlays)",position:"bottom",className:"cursor-help [&:before]:whitespace-normal [&:before]:max-w-xs [&:before]:text-left [&:before]:text-[11px] [&:before]:font-normal [&:before]:leading-snug z-20","data-testid":"summary-overview-tooltip",children:a.jsx("span",{className:"hover:text-primary transition-colors",children:"Token Activity & Cache Hit Ratio & Gain Ratio"})})})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("fieldset",{className:"flex items-center bg-base-300 p-0.5 rounded-lg text-xs border-0",children:[a.jsx("legend",{className:"sr-only",children:"Bucket interval"}),GG.map(W=>a.jsx("button",{type:"button","aria-pressed":i===W,className:`px-2 py-1 rounded font-medium transition-colors ${i===W?"bg-base-100 text-base-content font-bold shadow-sm":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>o?.(W),children:W},W))]}),a.jsx("div",{className:"flex items-center bg-base-300 p-0.5 rounded-lg text-xs",children:["chart","table"].map(W=>a.jsx("button",{type:"button","aria-pressed":u===W,className:`px-2.5 py-1 rounded font-medium transition-colors ${u===W?"bg-base-100 text-base-content font-bold shadow-sm":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>{c(W),p({model:W,source:W,tool:W,skill:W})},children:W==="chart"?"All Charts":"All Tables"},W))})]})]}),a.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[a.jsx(zo,{title:"By Model",description:"Token load by LLM model with cache hit ratio and gain ratio overlays",series:te,buckets:ye,chartMode:d.model,onToggleChartMode:f,testId:"summary-block-model"}),a.jsx(zo,{title:"By Source",description:"Token load by agent platform with cache hit ratio and gain ratio overlays",series:O,buckets:we,chartMode:d.source,onToggleChartMode:m,testId:"summary-block-source"}),a.jsx(zo,{title:"By Tool",description:"Token load (or call volume when unmeasured) by tool execution with cache hit ratio and gain ratio overlays",series:he,buckets:Pe,chartMode:d.tool,onToggleChartMode:b,testId:"summary-block-tool"}),a.jsx(zo,{title:"By Skill",description:"Token load by specialized skill with cache hit ratio and gain ratio overlays",series:be,buckets:ue,chartMode:d.skill,onToggleChartMode:x,testId:"summary-block-skill"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Token by Model"}),a.jsx("div",{className:"flex flex-col gap-3",children:A.map(W=>a.jsx(ME,{item:W,maxTotal:w},W.id))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Token by Agent"}),a.jsx("div",{className:"flex flex-col gap-3",children:N.map(W=>a.jsx(ME,{item:W,maxTotal:w},W.id))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Cache Efficiency By Model"}),G.byModel&&G.byModel.length>0&&a.jsx(FE,{items:G.byModel.map(W=>({id:W.model,label:W.modelName,color:W.color,hitRatio:W.hitRatio,savedTokens:W.savedTokens,totalRead:W.totalRead,billedTokens:W.billedTokens}))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Cache Efficiency By Agent"}),(G.bySource&&G.bySource.length>0||N.length>0)&&a.jsx(FE,{items:(G.bySource&&G.bySource.length>0?G.bySource:N.map(W=>({source:W.id,sourceName:W.label,color:W.color,hitRatio:G.hitRatio,savedTokens:Math.round(G.savedTokens*(W.share/100)),totalRead:Math.round(G.totalRead*(W.share/100)),billedTokens:W.tokens}))).map(W=>({id:W.source,label:W.sourceName,color:W.color,hitRatio:W.hitRatio,savedTokens:W.savedTokens,totalRead:W.totalRead,billedTokens:W.billedTokens}))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Agent × Model Correlation Matrix"}),q.length>0&&re.length>0&&a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"text-left pr-2 py-1 text-base-content/60 sticky left-0 bg-base-200 z-10",children:"Model \\ Agent"}),re.map(W=>a.jsx("th",{className:"px-1 py-1 text-base-content/60 whitespace-nowrap",title:I.get(W)??W,children:I.get(W)??W},W))]})}),a.jsx("tbody",{children:q.map(W=>a.jsxs("tr",{children:[a.jsx("td",{className:"pr-2 py-1 font-bold text-base-content/80 whitespace-nowrap sticky left-0 bg-base-200",children:W}),re.map(_e=>{const Be=pe.get(`${_e}\0${W}`);return a.jsx("td",{className:"p-0.5",children:Be?a.jsxs("div",{className:"h-8 min-w-[3rem] rounded-md flex items-center justify-center text-[10px] font-bold border border-base-content/10 cursor-default",style:{background:`rgba(6, 182, 212, ${.08+.5*(Be.hitRatio/100)})`},title:`${Be.sourceName} × ${Be.modelName}: ${Be.hitRatio}% hit · saved ${Ce(Be.savedTokens)} / read ${Ce(Be.totalRead)} / billed ${Ce(Be.billedTokens)}`,children:[Be.hitRatio,"%"]}):a.jsx("div",{className:"h-8 min-w-[3rem] rounded-md flex items-center justify-center text-[10px] text-base-content/25 bg-base-300/40",children:"—"})},_e)})]},W))})]})}),a.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono text-base-content/60",children:[a.jsx("span",{children:"0%"}),a.jsx("div",{className:"h-1.5 w-32 rounded-full bg-gradient-to-r from-base-300 to-cyan-400"}),a.jsx("span",{children:"100% cache hit ratio"})]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-2",children:"Top Tools & Error Rates"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Tool"}),a.jsx("th",{className:"py-1.5 min-w-[120px]",children:"Usage Share"}),a.jsx("th",{className:"py-1.5 min-w-[120px]",children:"Time Share"}),a.jsx("th",{className:"py-1.5 min-w-[120px]",children:"Token Share"}),a.jsx("th",{className:"py-1.5 text-right",children:"Calls"}),a.jsx("th",{className:"py-1.5 text-right",children:"Errors"}),a.jsx("th",{className:"py-1.5 text-right",children:"Error Rate"})]})}),a.jsx("tbody",{children:ie.map(W=>{const _e=W.usageShare??(At>0?Math.round(W.count/At*1e3)/10:0),Be=W.timeShare??(ft>0?Math.round((W.durationMs??0)/ft*1e3)/10:0),ut=W.tokenShare??(dt>0?Math.round((W.tokens??0)/dt*1e3)/10:0);return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30",children:[a.jsx("td",{className:"py-1.5 font-bold",children:W.id}),a.jsx("td",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16",children:a.jsx(fi,{value:_e,max:100,color:"#3987e5"})}),a.jsx("span",{className:"tabular-nums text-[10px] text-base-content/70",children:Wn(_e)})]})}),a.jsx("td",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16",children:a.jsx(fi,{value:Be,max:100,color:"#10b981"})}),a.jsx("span",{className:"tabular-nums text-[10px] text-base-content/70",children:Be>0?Wn(Be):"—"})]})}),a.jsx("td",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16",children:a.jsx(fi,{value:ut,max:100,color:"#f59e0b"})}),a.jsx("span",{className:"tabular-nums text-[10px] text-base-content/70",children:ut>0?Wn(ut):"—"})]})}),a.jsx("td",{className:"py-1.5 text-right tabular-nums",children:Ct(W.count)}),a.jsx("td",{className:"py-1.5 text-right tabular-nums",children:W.errors>0?Ct(W.errors):"0"}),a.jsx("td",{className:"py-1.5 text-right",children:a.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] ${W.errorRate>1?"bg-error/20 text-error font-bold":"bg-base-300 text-base-content/70"}`,children:Wn(W.errorRate)})})]},W.id)})})]})})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col gap-4",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Efficiency Stats & Skills"}),a.jsx("div",{children:a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs font-mono",children:[a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"text-base-content/60 text-[10px] uppercase tracking-wider",children:"Avg Billed / Session"}),a.jsx("span",{className:"font-bold",children:Ce(Ot)}),a.jsx(Vd,{current:Ot,previous:De,invert:!0})]}),a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"text-base-content/60 text-[10px] uppercase tracking-wider",children:"Avg Billed / Step"}),a.jsx("span",{className:"font-bold",children:Ce(qe)}),a.jsx(Vd,{current:qe,previous:Ke,invert:!0})]}),a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"text-base-content/60 text-[10px] uppercase tracking-wider",children:"Loop Detection Findings"}),a.jsxs("span",{className:"font-bold",children:[Ct(l?.redundantCalls??0)," redundant"]}),a.jsxs("span",{className:"text-[10px] text-base-content/60",children:[Ce(l?.wastedTokens??0)," wasted"]})]})]})}),k.length>0&&a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2",children:"Skills Invocation Mix"}),a.jsx(RE,{buckets:Ye,series:qG(k),height:150}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:k.map(W=>a.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-base-300 border border-base-content/10 gap-1.5 font-mono text-[11px]",children:[a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:W.color}}),a.jsxs("span",{children:[W.label,":"]}),a.jsxs("span",{className:"font-bold",children:[Ce(Ae[W.id]??0)," tokens"]})]},W.id))})]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col gap-4","data-testid":"summary-skill-breakdown",children:[a.jsx("div",{children:a.jsx("h4",{className:"font-bold text-sm",children:a.jsx(Br,{tip:"Skill invocations by name, agent, and invocation kind over the selected window.",position:"top",className:"cursor-help [&:before]:whitespace-normal [&:before]:max-w-xs [&:before]:text-left [&:before]:text-[11px] [&:before]:font-normal [&:before]:leading-snug z-20","data-testid":"summary-skill-breakdown-tooltip",children:a.jsx("span",{className:"hover:text-primary transition-colors",children:"Skill Load Breakdown"})})})}),C.fresh===!1?a.jsx("div",{className:"flex flex-col items-center justify-center text-[11px] text-base-content/40 font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30 py-6",children:a.jsx("span",{children:"Skill rollup not yet built — run history analyze to populate this section."})}):C.bySkill.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"Top Skills"}),a.jsx("div",{className:"flex flex-col gap-1.5",children:C.bySkill.map((W,_e)=>a.jsxs("div",{className:"flex justify-between items-center gap-2",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:Yr[_e%Yr.length]??"#3987e5"}}),W.skillName]}),a.jsx("span",{className:"font-bold tabular-nums",children:Ct(W.calls)})]},W.skillName))})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"By Agent"}),a.jsx("div",{className:"flex flex-col gap-1.5",children:C.bySource.map(W=>a.jsxs("div",{className:"flex justify-between items-center gap-2",children:[a.jsx("span",{children:W.source}),a.jsx("span",{className:"font-bold tabular-nums",children:Ct(W.calls)})]},W.source))})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"By Invocation Kind"}),a.jsx("div",{className:"flex flex-col gap-1.5",children:C.byInvocationKind.map(W=>a.jsxs("div",{className:"flex justify-between items-center gap-2",children:[a.jsx("span",{className:"capitalize",children:W.invocationKind}),a.jsx("span",{className:"font-bold tabular-nums",children:Ct(W.calls)})]},W.invocationKind))})]})]}),at.length>0&&a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"Skill Call Trend"}),a.jsx(RE,{buckets:at,series:Qe,height:150})]})]}):a.jsx("div",{className:"flex flex-col items-center justify-center text-[11px] text-base-content/40 font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30 py-6",children:a.jsx("span",{children:"No skill activity recorded for this window."})})]})]})}),qG=e=>e.map(t=>({id:t.id,label:t.label,color:t.color})),ME=g.memo(({item:e,maxTotal:t})=>{const n=e.freshInputTokens??(e.outputTokens?e.tokens-e.outputTokens:e.tokens),r=e.cacheReadTokens??0,s=e.outputTokens??0,i=t>0?t:1,o=l=>`${Math.round(l/i*1e3)/10}%`;return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex justify-between text-xs font-mono",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{background:e.color}}),e.label]}),a.jsx("span",{children:Ce(e.tokens)})]}),a.jsxs("div",{className:"w-full bg-base-300 h-3 rounded-full overflow-hidden flex",children:[n>0&&a.jsx("div",{className:"h-full",style:{width:o(n),background:"#3987e5"}}),s>0&&a.jsx("div",{className:"h-full",style:{width:o(s),background:"#f59e0b"}})]}),a.jsxs("div",{className:"flex justify-between text-[10px] text-base-content/60 font-mono",children:[a.jsxs("span",{children:["Fresh ",Ce(n)," · Cached ",Ce(r)," · Output ",Ce(s)]}),a.jsxs("span",{children:["Total ",Ce(n+r+s)]})]})]})}),FE=g.memo(({items:e})=>a.jsx("div",{className:"flex flex-col gap-2",children:e.map(t=>a.jsxs("div",{className:"flex flex-col gap-1 bg-base-300/40 p-2.5 rounded-lg border border-base-content/5",children:[a.jsxs("div",{className:"flex justify-between items-center text-xs",children:[a.jsxs("span",{className:"flex items-center gap-1.5 font-medium",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{background:t.color}}),t.label]}),a.jsxs("span",{className:"font-mono font-bold text-cyan-400",children:[t.hitRatio,"%"]})]}),a.jsx("div",{className:"w-full bg-base-100 h-1.5 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${t.hitRatio}%`,background:t.color}})}),a.jsxs("div",{className:"flex justify-between text-[10px] text-base-content/60 font-mono",children:[a.jsxs("span",{children:["Saved: ",Ce(t.savedTokens)]}),a.jsxs("span",{children:["Total Read: ",Ce(t.totalRead)," · Billed: ",Ce(t.billedTokens)]})]})]},t.id))})),VG=({blocks:e,start:t,end:n,onJumpToTime:r})=>{const s=g.useId(),{bins:i,maxBinTokens:o,maxBinOperations:l,startMs:u,endMs:c,hasValidRange:d}=g.useMemo(()=>{if(!t||!n||e.length===0)return{bins:[],maxBinTokens:0,maxBinOperations:0,startMs:0,endMs:0,hasValidRange:!1};const p=Date.parse(t),f=Date.parse(n);if(Number.isNaN(p)||Number.isNaN(f)||f<p)return{bins:[],maxBinTokens:0,maxBinOperations:0,startMs:0,endMs:0,hasValidRange:!1};const m=96,x=Math.max(1,f-p)/m,y=Array.from({length:m},(S,A)=>({index:A,timeMs:p+A*x,tokens:0,operations:0}));for(const S of e){if(!S.timestamp)continue;const A=Date.parse(S.timestamp);if(Number.isNaN(A)||A<p||A>f)continue;const N=Math.min(m-1,Math.max(0,Math.floor((A-p)/x))),T=y[N];T&&(T.tokens+=S.totalTokens,T.operations+=S.operationCount)}const E=Math.max(1,...y.map(S=>S.tokens)),v=Math.max(1,...y.map(S=>S.operations));return{bins:y,maxBinTokens:E,maxBinOperations:v,startMs:p,endMs:f,hasValidRange:!0}},[e,t,n]);return!d||i.length===0?null:a.jsxs("div",{"data-testid":"timeline-scrubber",className:"flex flex-col gap-1.5 p-3 bg-base-200/80 rounded-xl border border-base-content/10 font-mono text-xs",children:[a.jsxs("div",{className:"flex items-center justify-between text-[11px] text-base-content/60 px-1",children:[a.jsxs("span",{children:["Timeline Activity (",i.length," bins)"]}),a.jsxs("span",{children:["Peak: ",Ce(o)]})]}),a.jsx("div",{className:"relative h-10 w-full bg-base-300/60 rounded-lg overflow-hidden flex items-end p-1",children:a.jsx("svg",{viewBox:"0 0 96 32",preserveAspectRatio:"none",className:"w-full h-full text-primary/70","aria-hidden":"true",children:i.map(p=>{const f=p.operations>0?Math.max(2,Math.round(p.operations/l*30)):0,m=p.tokens>0?.35+p.tokens/o*.65:.25,b=32-f;return a.jsx("rect",{x:p.index,y:b,width:"0.85",height:f,fill:"currentColor",fillOpacity:m,"data-operations":p.operations,"data-tokens":p.tokens,className:"hover:text-cyan-400 transition-colors",children:a.jsx("title",{children:`${new Date(p.timeMs).toISOString()} · ${Ce(p.tokens)} · ${p.operations} ops`})},p.index)})})}),a.jsx("label",{htmlFor:s,className:"sr-only",children:"Timeline scrub slider"}),a.jsx("input",{id:s,type:"range",min:u,max:c,defaultValue:u,"aria-label":"Timeline navigation scrubber","data-testid":"timeline-scrubber-range",className:"w-full range range-xs range-primary cursor-pointer accent-primary",onInput:p=>{const f=Number(p.currentTarget.value);Number.isFinite(f)&&r?.(new Date(f).toISOString())}})]})},Cs=(e,t)=>`${e}:${t}`,Is=(e,t)=>JSON.stringify([e,t]),Kr=e=>e.replace(/[^a-zA-Z0-9_-]/g,"-"),Ll=(e,t,n)=>e+t+n,YG=(e,t)=>{const n=e+t;return n>0?t/n*100:0},Yd=e=>e.length<=12?e:`${e.slice(0,8)}…${e.slice(-4)}`,KG=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vv=e=>{if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=KG[t.getUTCMonth()],r=t.getUTCDate(),s=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0");return`${n} ${r} ${s}:${i}`},Kd=e=>{if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e.slice(11,19)||e;const n=String(t.getUTCHours()).padStart(2,"0"),r=String(t.getUTCMinutes()).padStart(2,"0"),s=String(t.getUTCSeconds()).padStart(2,"0");return`${n}:${r}:${s}`},PE=e=>`${Yd(e.id)} · ${e.source} · ${vv(e.start)} · ${Ce(e.tokenLoad)}`,ZG=e=>{const t=e.payload?.trim();return t&&t.length>0?t:e.title},BE=e=>e.split(/\r?\n/).map(n=>n.trim()).find(n=>n.length>0)??e,UE=e=>e.kind==="assistant"||e.eventType==="message"&&e.kind!=="user",XG=e=>{const t=(e.toolName||e.kind||"").toLowerCase();return t.includes("glob")?{label:e.toolName||"glob",color:"#6366f1"}:t.includes("grep")?{label:e.toolName||"grep",color:"#a855f7"}:t.includes("edit")||t.includes("write")||t.includes("patch")?{label:e.toolName||"edit",color:"#eab308"}:t.includes("read")||t.includes("view")||t.includes("list")?{label:e.toolName||"read",color:"#10b981"}:t.includes("bash")||t.includes("exec")||t.includes("command")||t.includes("terminal")?{label:e.toolName||"bash",color:"#3b82f6"}:t.includes("search")||t.includes("find")?{label:e.toolName||"search",color:"#a855f7"}:t.includes("run")?{label:e.toolName||"run",color:"#f59e0b"}:{label:e.toolName||e.kind,color:"#64748b"}},QG=()=>a.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"User icon",children:[a.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),a.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),JG=({promptTokens:e,fullText:t,tooltipId:n})=>{const[r,s]=g.useState(!1),i=e?.freshInputTokens??0,o=e?.cacheReadTokens??0,l=e?.outputTokens??0,u=Ll(i,o,l),c=t.length>0?t.split(/\r?\n/).length:0,d=t.length;return a.jsxs("div",{className:"relative inline-flex items-center z-20",children:[a.jsx("button",{type:"button","aria-label":"Show user prompt token breakdown","aria-describedby":n,"data-testid":`timeline-user-badge-${n}`,className:"p-1 rounded bg-base-300 text-cyan-400 shrink-0 hover:bg-base-content/10 focus:outline-none focus-visible:ring-1 focus-visible:ring-primary transition-colors cursor-pointer",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>s(!0),onBlur:()=>s(!1),onKeyDown:p=>{p.key==="Escape"&&s(!1)},children:a.jsx(QG,{})}),a.jsxs("div",{id:n,role:"tooltip","data-testid":n,className:`absolute left-0 top-full z-50 mt-1.5 w-56 p-2 rounded-lg bg-base-300 border border-base-content/20 shadow-2xl text-[11px] font-mono leading-relaxed pointer-events-none ${r?"block":"hidden"}`,children:[a.jsx("div",{className:"font-bold text-base-content mb-1",children:"User Prompt Telemetry"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80",children:[a.jsx("span",{className:"text-base-content/60",children:"Lines / chars:"}),a.jsxs("span",{children:[c," lines (",d," chars)"]}),a.jsx("span",{className:"text-base-content/60",children:"📥 Fresh input:"}),a.jsx("span",{children:Ce(i)}),a.jsx("span",{className:"text-base-content/60",children:"💾 Cache read:"}),a.jsx("span",{className:"text-cyan-400",children:Ce(o)}),a.jsx("span",{className:"text-base-content/60",children:"📤 Output:"}),a.jsx("span",{children:Ce(l)}),a.jsx("span",{className:"text-base-content/60 border-t border-base-content/10 pt-0.5",children:"⚡ Turn load:"}),a.jsx("span",{className:"font-bold border-t border-base-content/10 pt-0.5 text-primary",children:Ce(u)})]})]})]})},$E=({agentId:e,model:t,timestamp:n,tooltipId:r,freshInputTokens:s=0,cacheReadTokens:i=0,outputTokens:o=0,sessionId:l})=>{const[u,c]=g.useState(!1),d=Ll(s,i,o);return a.jsxs("div",{className:"relative inline-flex items-center z-20",children:[a.jsx("button",{type:"button","aria-label":`Show ${e} metadata and token breakdown`,"aria-describedby":r,"data-testid":`timeline-agent-badge-${r}`,className:"inline-flex items-center justify-center p-1 rounded hover:bg-base-content/10 text-base-content focus:outline-none focus-visible:ring-1 focus-visible:ring-primary transition-colors cursor-pointer",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:p=>{p.key==="Escape"&&c(!1)},children:a.jsx(or,{id:e})}),a.jsxs("div",{id:r,role:"tooltip","data-testid":r,className:`absolute left-0 top-full z-50 mt-1.5 w-60 p-2.5 rounded-xl bg-base-300 border border-base-content/20 shadow-2xl text-[11px] font-mono leading-relaxed pointer-events-none ${u?"block":"hidden"}`,children:[a.jsxs("div",{className:"font-bold text-base-content mb-1.5 flex items-center gap-1.5 border-b border-base-content/10 pb-1",children:[a.jsx(or,{id:e}),a.jsx("span",{className:"uppercase",children:e}),a.jsxs("span",{className:"text-base-content/50 font-normal truncate",children:["(",t,")"]})]}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80 text-[10.5px]",children:[a.jsx("span",{className:"text-base-content/60",children:"Timestamp:"}),a.jsx("span",{className:"truncate",children:Kd(n)}),l&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-base-content/60",children:"Session:"}),a.jsx("span",{className:"truncate font-bold text-primary",children:l})]})]}),a.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-base-content/10",children:[a.jsx("div",{className:"font-bold text-base-content/70 text-[10px] uppercase tracking-wider mb-0.5",children:"Token Breakdown"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80 text-[10.5px]",children:[a.jsx("span",{className:"text-base-content/60",children:"📥 Fresh input:"}),a.jsx("span",{children:Ce(s)}),a.jsx("span",{className:"text-base-content/60",children:"💾 Cache read:"}),a.jsx("span",{className:"text-cyan-400",children:Ce(i)}),a.jsx("span",{className:"text-base-content/60",children:"📤 Output:"}),a.jsx("span",{children:Ce(o)}),a.jsx("span",{className:"text-base-content/60 border-t border-base-content/10 pt-0.5",children:"⚡ Total:"}),a.jsx("span",{className:"font-bold border-t border-base-content/10 pt-0.5 text-primary",children:Ce(d)})]})]})]})]})},Av=({data:e,loading:t,error:n,mode:r="session",sessionId:s,availableSessions:i=[],onSelectSession:o,onModeChange:l,consolidatedTaskWbs:u="",consolidatedRunId:c="",onConsolidatedScopeSubmit:d})=>{const p=e?.scope.sessionId,f=e?.scope.source,[m,b]=g.useState({}),[x,y]=g.useState(!0),[E,v]=g.useState(!0),[S,A]=g.useState(!0),[N,T]=g.useState(u),[w,k]=g.useState(c),F=p&&f?Is(f,p):"consolidated",C=m[F]||{},$=Y=>{b(me=>({...me,[F]:Y(me[F]||{})}))},z=(Y,me)=>{const te=Cs(Y,me);$(O=>({...O,[te]:!O[te]}))};if(t)return a.jsx("div",{className:"flex items-center justify-center p-16",children:a.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-primary border-t-transparent animate-spin motion-reduce:animate-none"})});if(n)return a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error",children:a.jsxs("span",{children:["Failed to load timeline: ",n]})});if(!e)return a.jsx("div",{className:"p-4 rounded-lg bg-info/10 border border-info/20 text-info",children:a.jsx("span",{children:"No timeline data available."})});const{scope:M,blocks:G,truncated:H}=e,j=Ll(M.tokens.freshInputTokens,M.tokens.cacheReadTokens,M.tokens.outputTokens),q=YG(M.tokens.freshInputTokens,M.tokens.cacheReadTokens),re=G.map(Y=>{const me=Y.events.filter(te=>UE(te)?!x:te.kind==="unknown"||te.agent==="unknown"?!E:!(S&&!te.payload?.trim()&&(te.durationMs===null||te.durationMs===0)&&Ll(te.freshInputTokens,te.cacheReadTokens,te.outputTokens)===0));return{...Y,events:me}}).filter(Y=>Y.events.length>0),pe=re.flatMap(Y=>Y.events.filter(me=>!!me.payload?.trim()).map(me=>Cs(Y.key,me.seq))),I=pe.length>0&&pe.every(Y=>C[Y]),Z=()=>$(()=>I?{}:Object.fromEntries(pe.map(Y=>[Y,!0]))),ie=i.findIndex(Y=>Y.id===M.sessionId&&Y.source===M.source),L=ie>0?i[ie-1]:void 0,Ee=ie>=0&&ie<i.length-1?i[ie+1]:void 0,fe=Y=>{const me=Date.parse(Y),te=re.find(O=>{const he=O.timestamp?Date.parse(O.timestamp):Number.NaN;return Number.isFinite(he)&&he>=me})??re.at(-1);te&&document.getElementById(`timeline-block-${Kr(te.key)}`)?.scrollIntoView({behavior:"smooth",block:"center"})};return a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5 flex flex-col gap-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx("h3",{className:"text-base font-bold tracking-tight",children:"Conversation"}),a.jsxs("fieldset",{className:"inline-flex border border-base-content/20 rounded-lg p-0.5 bg-base-300 font-mono text-xs",children:[a.jsx("legend",{className:"sr-only",children:"Timeline mode"}),a.jsx("button",{type:"button","data-testid":"timeline-mode-session","aria-pressed":r==="session",className:`px-3 py-1 font-bold rounded-md transition-all cursor-pointer ${r==="session"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content"}`,onClick:()=>l?.("session"),children:"Single Session"}),a.jsx("button",{type:"button","data-testid":"timeline-mode-consolidated","aria-pressed":r==="consolidated",className:`px-3 py-1 font-bold rounded-md transition-all cursor-pointer ${r==="consolidated"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content"}`,onClick:()=>l?.("consolidated"),children:"Consolidated"})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[r==="session"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"sr-only",children:"Session"}),a.jsx("select",{"aria-label":"Select Session","data-testid":"timeline-session-select",className:"px-3 py-1.5 min-h-[44px] text-xs rounded-lg border border-base-content/20 bg-base-300 font-mono text-base-content max-w-xs focus:outline-hidden focus:border-primary cursor-pointer",value:M.source&&M.sessionId?Is(M.source,M.sessionId):"",onChange:Y=>{const me=i.find(te=>Is(te.source,te.id)===Y.target.value);me&&o?.(me.source,me.id)},children:i.length>0?i.map(Y=>a.jsx("option",{value:Is(Y.source,Y.id),children:PE(Y)},Is(Y.source,Y.id))):a.jsx("option",{value:M.source&&M.sessionId?Is(M.source,M.sessionId):"",children:M.sessionId?PE({id:M.sessionId,source:M.source??"unknown",start:M.start??"",tokenLoad:j}):"No session selected"})})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button","aria-label":"Previous session",disabled:!L,className:"px-3 py-2 min-h-[44px] min-w-[44px] inline-flex items-center justify-center text-xs font-mono rounded-lg border border-base-content/20 bg-base-300 text-base-content/80 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-base-content/10 transition-colors focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",onClick:()=>L&&o?.(L.source,L.id),children:"←"}),a.jsx("button",{type:"button","aria-label":"Next session",disabled:!Ee,className:"px-3 py-2 min-h-[44px] min-w-[44px] inline-flex items-center justify-center text-xs font-mono rounded-lg border border-base-content/20 bg-base-300 text-base-content/80 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-base-content/10 transition-colors focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",onClick:()=>Ee&&o?.(Ee.source,Ee.id),children:"→"})]})]}):a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-base-300 border border-base-content/20 text-xs font-mono",children:[a.jsx("span",{className:"text-base-content/60",children:"Scope:"}),a.jsxs("span",{className:"font-semibold text-primary",children:[M.sessionCount," sessions"]})]}),a.jsxs("form",{className:"flex flex-wrap items-end gap-2",onSubmit:Y=>{Y.preventDefault(),d?.({taskWbs:N.trim(),runId:w.trim()})},children:[a.jsxs("label",{className:"flex flex-col gap-1 text-[10px] font-mono text-base-content/60",children:["Task WBS",a.jsx("input",{type:"text",value:N,onInput:Y=>T(Y.currentTarget.value),className:"min-h-[44px] w-28 rounded-lg border border-base-content/20 bg-base-300 px-2 text-xs text-base-content focus:outline-hidden focus:border-primary"})]}),a.jsxs("label",{className:"flex flex-col gap-1 text-[10px] font-mono text-base-content/60",children:["Run ID",a.jsx("input",{type:"text",value:w,onInput:Y=>k(Y.currentTarget.value),className:"min-h-[44px] w-40 rounded-lg border border-base-content/20 bg-base-300 px-2 text-xs text-base-content focus:outline-hidden focus:border-primary"})]}),a.jsx("button",{type:"submit",className:"min-h-[44px] rounded-lg bg-primary px-3 text-xs font-semibold text-primary-content focus-visible:ring-2 focus-visible:ring-primary cursor-pointer hover:bg-primary/90 transition-colors",children:"Apply scope"})]})]}),a.jsx("button",{type:"button","aria-pressed":I,disabled:pe.length===0,className:"px-3.5 py-2 min-h-[44px] rounded-lg text-xs font-semibold border border-primary/30 text-primary hover:bg-primary/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",onClick:Z,children:I?"Collapse all":"Expand all"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs font-mono text-base-content/80",children:[a.jsxs("label",{className:"inline-flex items-center gap-1.5 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox","data-testid":"timeline-filter-assistant",className:"w-3.5 h-3.5 rounded border border-base-content/30 accent-primary focus-visible:ring-1 focus-visible:ring-primary",checked:x,onChange:Y=>y(Y.target.checked)}),a.jsx("span",{children:"Hide assistant"})]}),a.jsxs("label",{className:"inline-flex items-center gap-1.5 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox","data-testid":"timeline-filter-unknown",className:"w-3.5 h-3.5 rounded border border-base-content/30 accent-primary focus-visible:ring-1 focus-visible:ring-primary",checked:E,onChange:Y=>v(Y.target.checked)}),a.jsx("span",{children:"Hide unknown"})]}),a.jsxs("label",{className:"inline-flex items-center gap-1.5 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox","data-testid":"timeline-filter-empty",className:"w-3.5 h-3.5 rounded border border-base-content/30 accent-primary focus-visible:ring-1 focus-visible:ring-primary",checked:S,onChange:Y=>A(Y.target.checked)}),a.jsx("span",{children:"Hide other empty"})]})]})]})]}),a.jsxs("div",{"data-testid":"timeline-metadata-strip",className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-9 gap-3 pt-3 border-t border-base-content/10 text-xs font-mono",children:[a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:r==="session"?"SESSION":"SESSIONS"}),a.jsx("span",{className:"font-semibold truncate text-base-content mt-0.5",title:M.sessionId??`${M.sessionCount} sessions`,children:M.sessionId?Yd(M.sessionId):`${M.sessionCount} total`})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"AGENT"}),a.jsx("span",{className:"inline-flex items-center gap-1 font-semibold truncate text-base-content mt-0.5",children:M.source?a.jsxs(a.Fragment,{children:[a.jsx(or,{id:M.source}),M.source]}):"multiple"})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"MODEL"}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate text-base-content mt-0.5",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary/70 shrink-0"}),M.model??"multiple"]})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"STARTED"}),a.jsx("span",{className:"truncate text-base-content/80 mt-0.5",children:vv(M.start)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"DURATION"}),a.jsx("span",{className:"font-semibold truncate text-base-content mt-0.5",children:fv(M.durationMs/6e4)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"TOTAL TOKENS"}),a.jsx("span",{className:"font-bold text-primary truncate mt-0.5",children:Ce(j)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"CACHE READ"}),a.jsxs("span",{className:"font-semibold text-cyan-400 truncate mt-0.5",children:[q.toFixed(1),"%"]})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"OUTPUT TOKENS"}),a.jsx("span",{className:"truncate text-base-content/80 mt-0.5",children:Ce(M.tokens.outputTokens)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"TOOL CALLS"}),a.jsx("span",{className:"truncate text-base-content font-bold mt-0.5",children:Ct(M.toolCallCount)})]})]}),a.jsx(VG,{blocks:re,start:M.start,end:M.end,onJumpToTime:fe})]}),H&&a.jsxs("div",{"data-testid":"timeline-truncated-banner",className:"p-3 rounded-lg bg-info/10 border border-info/20 text-info font-mono text-xs flex items-center gap-2",children:[a.jsx("span",{children:"ℹ️"}),a.jsx("span",{children:"Showing newest 5,000 events. Apply a narrower filter or time window to inspect earlier events."})]}),a.jsx("div",{"data-testid":"timeline-rail",className:"relative py-2 sm:py-4 before:absolute before:left-2 sm:before:left-[136px] before:top-0 before:bottom-0 before:w-[2px] before:bg-base-content/20 flex flex-col gap-3",children:re.map(Y=>{const me=Y.events.filter(O=>O.kind==="user"),te=Y.events.filter(O=>O.kind!=="user");return a.jsxs("div",{id:`timeline-block-${Kr(Y.key)}`,"data-testid":`timeline-block-${Y.key}`,className:"flex flex-col gap-2.5",children:[r==="consolidated"&&a.jsxs("div",{className:"flex items-center gap-2 pl-6 sm:pl-[144px] pt-2 pb-1 font-mono text-xs text-base-content/70",children:[a.jsx(or,{id:Y.source}),a.jsx("span",{className:"font-bold text-base-content",children:Y.source}),a.jsxs("span",{children:["· ",Yd(Y.sessionId)]}),a.jsxs("span",{children:["· Turn #",Y.turnIndex]}),Y.correlationExactness&&a.jsx("span",{"data-testid":`timeline-exactness-${Y.key}`,className:`px-1.5 py-0.2 rounded text-[10px] font-bold ${Y.correlationExactness==="exact"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-amber-500/10 text-amber-400 border border-amber-500/20"}`,children:Y.correlationExactness})]}),me.map(O=>{const he=ZG(O),be=O.payload?.trim()??"",ye=BE(he),we=!!O.payload?.trim(),Pe=!!C[Cs(Y.key,O.seq)],ue=Kr(`timeline-user-drawer-${Y.key}-${O.seq}`),Ye=Kr(`user-tt-${Y.key}-${O.seq}`);return a.jsxs("div",{className:"relative flex flex-col sm:grid sm:grid-cols-[136px_minmax(0,1fr)] py-1","data-testid":`timeline-user-event-${Y.key}-${O.seq}`,children:[a.jsxs("div",{className:"hidden sm:flex flex-col items-end justify-center pr-4 font-mono text-[10.5px] text-base-content/80 select-none",title:Y.timestamp?`Timestamp: ${Kd(Y.timestamp)}`:void 0,children:[a.jsxs("span",{className:"font-semibold text-primary truncate",children:["📥 ",Ce(O.freshInputTokens)," in"]}),O.durationSource==="measured"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,className:O.durationMs>=5e3?"font-bold text-amber-400":"text-base-content/60",children:["⏱ ",Hs(O.durationMs)]}):O.durationSource==="inferred"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Inferred from next event timestamp within session",className:"text-base-content/60 italic",children:["⏱ ~",Hs(O.durationMs)]}):a.jsx("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Unmeasured (gap > 10m or last event)",className:"text-base-content/40",children:"⏱ —"})]}),a.jsx("span",{"data-timeline-node":"prompt",className:"absolute left-[3.5px] sm:left-[131.5px] top-1/2 -translate-y-1/2 w-[9px] h-[9px] rounded-full bg-cyan-400 ring-4 ring-base-100 z-10","aria-hidden":"true"}),a.jsx("div",{className:"pl-6 sm:pl-5 min-w-0 flex justify-end",children:a.jsxs("div",{className:"w-[80%] max-w-none bg-base-100 rounded-xl border border-primary/20 hover:border-primary/40 hover:bg-base-200/40 transition-all p-2.5 sm:px-3.5 sm:py-2.5 flex flex-col gap-1 shadow-xs relative",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-[32px]",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:"relative z-10",children:a.jsx(JG,{promptTokens:O.promptTokens,fullText:be,tooltipId:Ye})}),a.jsx("span",{className:"font-mono text-xs font-semibold text-base-content/90 truncate min-w-0",children:ye})]}),a.jsx("div",{className:"flex items-center gap-2 shrink-0 font-mono text-[11px] text-base-content/60",children:we?a.jsx("button",{type:"button","aria-label":Pe?"Collapse full user prompt":"Expand full user prompt","aria-expanded":Pe,"aria-controls":ue,onClick:()=>z(Y.key,O.seq),className:"p-1 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 inline-flex items-center justify-center text-base-content/60 hover:text-base-content transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary rounded after:absolute after:inset-0 after:rounded-xl after:content-['']",children:a.jsx("span",{className:`text-xs font-mono transition-transform duration-150 ${Pe?"rotate-90":""}`,"aria-hidden":"true",children:"›"})}):null})]}),Pe&&we&&a.jsx("div",{id:ue,className:"mt-1 p-3 bg-[#0d141f] text-slate-100 rounded-md font-mono text-xs whitespace-pre-wrap overflow-x-auto border border-white/10 relative z-10",children:Gc(he)})]})})]},Cs(Y.key,O.seq))}),te.map(O=>{const he=XG(O),be=!!C[Cs(Y.key,O.seq)],ye=!!O.payload?.trim(),we=Kr(`timeline-op-drawer-${Y.key}-${O.seq}`),Pe=Kr(`agent-tt-${Y.key}-${O.seq}`),ue=Kr(`tool-tt-${Y.key}-${O.seq}`),Ye=UE(O);return a.jsxs("div",{className:"relative flex flex-col sm:grid sm:grid-cols-[136px_minmax(0,1fr)] py-1 hover:z-30 focus-within:z-30","data-testid":`timeline-op-event-${Y.key}-${O.seq}`,children:[a.jsxs("div",{className:"hidden sm:flex flex-col items-end justify-center pr-4 font-mono text-[10.5px] text-base-content/80 select-none",title:Y.timestamp?`Timestamp: ${Kd(Y.timestamp)}`:void 0,children:[a.jsx("span",{className:"font-semibold text-base-content/90 truncate",children:Ye&&O.outputTokens>0?`📤 ${Ce(O.outputTokens)} out`:`⚡ ${Ce(O.tokens)} tok`}),O.durationSource==="measured"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,className:O.durationMs>=5e3?"font-bold text-amber-400":"text-base-content/60",children:["⏱ ",Hs(O.durationMs)]}):O.durationSource==="inferred"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Inferred from next event timestamp within session",className:"text-base-content/60 italic",children:["⏱ ~",Hs(O.durationMs)]}):a.jsx("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Unmeasured (gap > 10m or last event)",className:"text-base-content/40",children:"⏱ —"})]}),a.jsx("span",{"data-timeline-node":"operation",className:"absolute left-[3.5px] sm:left-[131.5px] top-1/2 -translate-y-1/2 w-[9px] h-[9px] rounded-full ring-4 ring-base-100 z-10",style:{backgroundColor:he.color},"aria-hidden":"true"}),a.jsx("div",{className:"pl-6 sm:pl-5 min-w-0 flex justify-start",children:Ye?a.jsxs("div",{className:"w-[80%] max-w-none bg-base-100 rounded-xl border border-base-content/10 border-l-[3px] border-l-primary/70 hover:border-base-content/30 hover:bg-base-200/40 transition-all relative shadow-xs",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2 min-h-[38px]",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:"relative z-10",children:a.jsx($E,{agentId:O.agent||Y.source,model:O.model||Y.model,timestamp:Y.timestamp,tooltipId:Pe,freshInputTokens:O.freshInputTokens,cacheReadTokens:O.cacheReadTokens,outputTokens:O.outputTokens,sessionId:Y.sessionId})}),a.jsx("span",{className:"font-mono text-xs text-base-content/60 truncate",children:O.model}),a.jsx("span",{className:"font-mono text-xs text-base-content/90 truncate min-w-0",children:BE(O.payload||O.title)})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0 font-mono text-[11px] text-base-content/60",children:[a.jsxs("span",{children:["📤 ",Ce(O.outputTokens)]}),ye?a.jsx("button",{type:"button","aria-label":be?"Collapse response":"Expand response","aria-expanded":be,"aria-controls":we,onClick:()=>z(Y.key,O.seq),className:"p-1 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 inline-flex items-center justify-center text-base-content/60 hover:text-base-content transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary rounded after:absolute after:inset-0 after:rounded-xl after:content-['']",children:a.jsx("span",{className:`text-xs font-mono transition-transform duration-150 ${be?"rotate-90":""}`,"aria-hidden":"true",children:"›"})}):null]})]}),be&&O.payload&&a.jsx("div",{id:we,className:"p-3 bg-[#0d141f] text-slate-100 font-mono text-xs whitespace-pre-wrap overflow-x-auto rounded-b-xl border-t border-base-content/10 relative z-10",children:Gc(O.payload,O.toolName)})]}):a.jsxs("div",{className:"w-[80%] max-w-none bg-base-100 rounded-xl border border-base-content/10 border-l-[3px] hover:border-base-content/30 hover:bg-base-200/40 transition-all relative shadow-xs",style:{borderLeftColor:he.color},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 px-2.5 py-1.5 min-h-[38px]",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:"relative z-10",children:a.jsx($E,{agentId:O.agent||Y.source,model:O.model||Y.model,timestamp:Y.timestamp,tooltipId:Pe,freshInputTokens:O.freshInputTokens,cacheReadTokens:O.cacheReadTokens,outputTokens:O.outputTokens,sessionId:Y.sessionId})}),a.jsx("span",{className:"relative z-10",children:a.jsx(rx,{item:{toolName:he.label,seq:O.seq,status:O.exitCode===0?"ok":O.exitCode!==null?"error":"ok",durationMs:O.durationMs,durationSource:O.durationSource,tokens:{billedTokens:O.tokens,freshInputTokens:O.freshInputTokens,cacheReadTokens:O.cacheReadTokens,outputTokens:O.outputTokens,cacheSavedTokens:0},argsRaw:O.payload,sessionId:Y.sessionId??p,source:O.agent||Y.source,model:O.model||Y.model,ts:Y.timestamp,errorText:O.exitCode!==null&&O.exitCode!==0?O.payload||`Exit code ${O.exitCode}`:null},categoryColor:he.color,testId:`timeline-tool-badge-${ue}`,tooltipId:ue,size:"xs"})}),O.title&&O.title.trim().length>0?a.jsx("span",{className:"font-mono text-xs font-semibold text-base-content/90 truncate min-w-0",title:O.title,children:O.title}):null]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0 font-mono",children:[O.exitCode!==null&&a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold relative z-10 ${O.exitCode===0?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":"bg-error/20 text-error border border-error/30"}`,children:["EXIT_CODE=",O.exitCode]}),ye?a.jsx("button",{type:"button","aria-label":be?"Collapse operation payload":"Expand operation payload","aria-expanded":be,"aria-controls":we,onClick:()=>z(Y.key,O.seq),className:"p-1 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 inline-flex items-center justify-center text-base-content/60 hover:text-base-content transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary rounded after:absolute after:inset-0 after:rounded-xl after:content-['']",children:a.jsx("span",{className:`text-xs font-mono transition-transform duration-150 ${be?"rotate-90":""}`,"aria-hidden":"true",children:"›"})}):null]})]}),be&&O.payload&&a.jsx("div",{id:we,className:"p-3 bg-[#0d141f] text-slate-100 font-mono text-xs whitespace-pre-wrap overflow-x-auto rounded-b-xl border-t border-base-content/10 relative z-10",children:Gc(O.payload,he.label)})]})})]},Cs(Y.key,O.seq))})]},Y.key)})})]})},Wa=xr,kv=({data:e,loading:t=!1,error:n=null,mode:r="session",onModeChange:s=()=>{},sessionId:i,sessionSource:o,availableSessions:l=[],onSelectSession:u=()=>{},toolNames:c=[],onToolNamesChange:d=()=>{},status:p="all",onStatusChange:f=()=>{},search:m="",onSearchChange:b=()=>{}})=>{const x=e?.items??[],y=e?.scope,E=g.useMemo(()=>{const A=new Set;for(const N of x)A.add(N.toolName);return Array.from(A).sort()},[x]),v=A=>{c.includes(A)?d(c.filter(N=>N!==A)):d([...c,A])},S=c.length>0||p!=="all"||m.trim().length>0;return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col gap-4 shadow-xs",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pb-3 border-b border-base-content/10",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsxs("div",{className:"inline-flex bg-base-300 p-1 rounded-xl border border-base-content/5 text-xs font-mono",children:[a.jsx("button",{type:"button",className:`px-3.5 py-1.5 font-bold rounded-lg transition-all cursor-pointer ${r==="session"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content hover:bg-base-content/5"}`,onClick:()=>s("session"),children:"Single Session"}),a.jsx("button",{type:"button",className:`px-3.5 py-1.5 font-bold rounded-lg transition-all cursor-pointer ${r==="consolidated"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content hover:bg-base-content/5"}`,onClick:()=>s("consolidated"),children:"Consolidated Stream"})]}),r==="session"&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&a.jsx("span",{className:"w-5 h-5 flex items-center justify-center text-base-content/80",children:a.jsx(or,{id:o})}),a.jsx("select",{className:"bg-base-300 border border-base-content/20 rounded-xl px-3 py-1.5 text-xs font-mono max-w-sm focus:outline-hidden focus:border-primary cursor-pointer text-base-content",value:i?`${o??""}:${i}`:"",onChange:A=>{const N=A.target.value,[T,...w]=N.split(":");T&&w.length>0&&u(T,w.join(":"))},children:l.map(A=>a.jsxs("option",{value:`${A.source}:${A.id}`,children:["[",A.source,"] ",A.id.slice(0,16),"... (",A.model,")"]},`${A.source}:${A.id}`))})]})]}),r==="consolidated"&&a.jsx("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2.5 py-1 rounded-full",children:"Consolidated across all window sessions"})]}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3",children:[a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Total Calls"}),a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-lg font-bold font-mono text-base-content","data-testid":"tool-scope-calls",children:y?.totalCalls??0})})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Unique Tools"}),a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-lg font-bold font-mono text-base-content","data-testid":"tool-scope-unique",children:y?.uniqueTools??0})})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Errors / Rate"}),a.jsx("div",{className:"mt-1",children:a.jsxs("span",{className:`text-lg font-bold font-mono ${(y?.errorCount??0)>0?"text-error":"text-success"}`,"data-testid":"tool-scope-errors",children:[y?.errorCount??0," (",Math.round((y?.errorRate??0)*100),"%)"]})})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Mean Duration"}),a.jsxs("div",{className:"mt-1",children:[a.jsx("span",{className:"text-lg font-bold font-mono text-base-content","data-testid":"tool-scope-duration",children:y?.meanDurationMs?`${y.meanDurationMs} ms`:"—"}),(y?.durationUnmeasured??0)>0&&a.jsxs("span",{className:"text-[10px] text-base-content/50 ml-1 font-mono block",children:["(",y?.durationUnmeasured," unmeasured)"]})]})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Billed Tokens"}),a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-lg font-bold font-mono text-primary","data-testid":"tool-scope-tokens",children:y?Wa(y.tokens.billedTokens):0})})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-3 border-t border-base-content/10",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-base-content/60 font-semibold font-mono",children:"Status:"}),a.jsx("div",{className:"inline-flex bg-base-300 p-0.5 rounded-lg text-xs font-mono",children:["all","ok","error"].map(A=>a.jsx("button",{type:"button",className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${p===A?A==="error"?"bg-error text-error-content shadow-xs":"bg-base-content text-base-100 shadow-xs":"text-base-content/70 hover:bg-base-content/10"}`,onClick:()=>f(A),children:A.toUpperCase()},A))})]}),a.jsxs("div",{className:"flex-1 max-w-md relative",children:[a.jsx("span",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-xs opacity-40",children:"🔍"}),a.jsx("input",{type:"text",className:"bg-base-300 border border-base-content/20 rounded-xl pl-8 pr-7 py-1.5 w-full text-xs font-mono focus:outline-hidden focus:border-primary placeholder:text-base-content/40",placeholder:"Search tool arguments, digest, or error text...",value:m,onChange:A=>b(A.target.value)}),m&&a.jsx("button",{type:"button",onClick:()=>b(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-xs text-base-content/40 hover:text-base-content cursor-pointer",children:"✕"})]})]}),E.length>0&&a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pt-2 border-t border-base-content/5",children:[a.jsx("span",{className:"text-[11px] text-base-content/50 font-semibold font-mono",children:"Tools:"}),E.map(A=>{const N=c.includes(A);return a.jsx("button",{type:"button","data-testid":`tool-filter-${A}`,className:`px-2.5 py-0.5 rounded-full text-[11px] font-mono transition-all border cursor-pointer ${N?"bg-primary text-primary-content border-primary font-bold shadow-xs":"bg-base-300 text-base-content/80 border-base-content/10 hover:border-base-content/30"}`,onClick:()=>v(A),children:A},A)}),c.length>0&&a.jsxs("button",{type:"button",className:"text-[11px] text-base-content/60 hover:text-base-content underline ml-1 font-mono cursor-pointer",onClick:()=>d([]),children:["Clear (",c.length,")"]})]})]}),e?.truncated&&a.jsxs("div",{className:"bg-warning/10 text-warning border border-warning/20 p-3 rounded-xl text-xs font-medium flex items-center gap-2",children:[a.jsx("span",{children:"⚠️"}),a.jsxs("span",{children:["Showing the first ",x.length," tool calls. Refine your filters or search to narrow the scope."]})]}),n&&a.jsxs("div",{className:"bg-error/10 text-error border border-error/20 p-4 text-xs rounded-xl flex items-center gap-2",children:[a.jsx("span",{children:"⚠️"}),a.jsx("span",{children:n})]}),t&&x.length===0&&a.jsx("div",{className:"flex flex-col gap-2.5 animate-pulse",children:[1,2,3,4,5].map(A=>a.jsx("div",{className:"h-16 bg-base-200 rounded-xl border border-base-content/5"},A))}),!t&&!n&&x.length===0&&a.jsxs("div",{className:"bg-base-200/40 rounded-xl border border-base-content/10 p-12 text-center text-base-content/60 flex flex-col items-center gap-2",children:[a.jsx("span",{className:"text-3xl block mb-1",children:"🔍"}),a.jsx("p",{className:"text-sm font-semibold",children:"No tool calls found"}),a.jsx("p",{className:"text-xs max-w-sm",children:S?"No tool calls match your active filter criteria. Try clearing search or status filters.":"No tool invocations recorded for this scope."})]}),x.length>0&&a.jsx("div",{className:"flex flex-col gap-2 w-full",children:x.map(A=>{const N=`${A.sessionId}:${A.messageHash}:${A.toolSeq}`,T=Dl[A.category]??Dl.other,w=A.status==="error";return a.jsxs("div",{className:"w-full text-left group p-3 rounded-xl border border-base-content/10 hover:border-base-content/30 hover:bg-base-200/60 bg-base-200/30 transition-all flex items-center justify-between gap-3 relative","data-testid":`tool-item-${A.seq}`,children:[a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.jsx(UG,{agentId:A.source,model:A.model,timestamp:A.ts,freshInputTokens:A.tokens.freshInputTokens,cacheReadTokens:A.tokens.cacheReadTokens,outputTokens:A.tokens.outputTokens,sessionId:A.sessionId}),a.jsxs("span",{className:"text-xs font-mono text-base-content/40 font-bold min-w-[28px]",children:["#",A.seq]}),a.jsx($G,{item:A,categoryColor:T}),a.jsx("span",{className:"text-xs font-mono text-base-content/80 truncate min-w-0 flex-1",title:A.argsRaw||A.argsDigest||"",children:jG(A)})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0 text-xs font-mono",children:[a.jsx("span",{className:"text-base-content/70 tabular-nums",title:`Duration source: ${A.durationSource}`,children:A.durationMs!==null?`${A.durationMs} ms`:"—"}),a.jsxs("span",{className:"text-base-content/50 text-[11px] tabular-nums",title:`Tokens: ${Wa(A.tokens.freshInputTokens)} fresh input, ${Wa(A.tokens.cacheReadTokens)} cache read, ${Wa(A.tokens.outputTokens)} output`,children:[Wa(A.tokens.billedTokens)," tok"]}),a.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider border ${w?"bg-error/15 text-error border-error/30":"bg-emerald-500/15 text-emerald-400 border-emerald-500/30"}`,children:[a.jsx("span",{className:"w-1 h-1 rounded-full bg-current"}),A.status]})]})]},N)})})]})},eW=[{id:"summary",label:"Summary",component:wv},{id:"timeline",label:"Timeline",component:Av},{id:"tool-using",label:"Tool Using",component:kv},{id:"sessions",label:"Sessions",component:Tv},{id:"insights",label:"Insights",component:Sv},{id:"sources",label:"Sources",component:Nv}],Wo=(e,t)=>{const n=new Map;for(const r of e)n.set(r.id,r);for(const r of t??[])n.has(r)||n.set(r,{id:r,label:r});return[...n.values()]},tW=e=>e.range==="1h"?"Last 1h":e.range==="4h"?"Last 4h":e.range==="24h"?"Last 24h":e.range==="7d"?"Last 7d":e.range==="30d"?"Last 30d":e.range==="all"?"All time":`${e.from?.slice(0,10)??"…"} → ${e.to?.slice(0,10)??"…"}`,Rs=e=>e instanceof Error?e.message:String(e),nW=()=>{const[e,t]=g.useState("summary"),[n,r]=g.useState({range:"4h",bucket:"auto",dimension:"model"}),[s,i]=g.useState("session"),[o,l]=g.useState(null),[u,c]=g.useState({taskWbs:"",runId:""}),[d,p]=g.useState("session"),[f,m]=g.useState([]),[b,x]=g.useState("all"),[y,E]=g.useState(""),[v,S]=g.useState(""),[A,N]=g.useState(1),[T,w]=g.useState("start"),[k,F]=g.useState("desc"),[C,$]=g.useState(void 0),[z,M]=g.useState(void 0),[G,H]=g.useState(void 0),[j,q]=g.useState(void 0),[re,pe]=g.useState(void 0),[I,Z]=g.useState(void 0),[ie,L]=g.useState([]),[Ee,fe]=g.useState(!1),[Y,me]=g.useState(!0),[te,O]=g.useState(null),[he,be]=g.useState(!0),[ye,we]=g.useState(null),[Pe,ue]=g.useState(!0),[Ye,at]=g.useState(null),[Qe,At]=g.useState(!1),[ft,dt]=g.useState(null),[Ot,qe]=g.useState(!1),[De,Ke]=g.useState(null),[Q,le]=g.useState(!1),[Ae,W]=g.useState(null);g.useEffect(()=>{let ne=!0;return me(!0),O(null),be(!0),we(null),Pt.history.getSummary(n).then(de=>{ne&&(de?.data?$(de.data):O("Failed to load summary"))}).catch(de=>{ne&&O(Rs(de))}).finally(()=>{ne&&me(!1)}),Pt.history.getInsights(n).then(de=>{ne&&(de?.data?pe(de.data):we("Failed to load insights"))}).catch(de=>{ne&&we(Rs(de))}).finally(()=>{ne&&be(!1)}),()=>{ne=!1}},[n]),g.useEffect(()=>{let ne=!0;return ue(!0),at(null),(async()=>{try{const de=await Pt.history.getSources();if(!ne)return;de?.data?Z(de.data):at("Failed to load sources")}catch(de){ne&&at(Rs(de))}finally{ne&&ue(!1)}})(),()=>{ne=!1}},[]),g.useEffect(()=>{if(e!=="timeline"&&e!=="tool-using")return;let ne=!0;return fe(!0),(async()=>{try{const de=await Pt.history.getSessions({filter:n,page:1,pageSize:100,sortBy:"start",sortDir:"desc"});if(!ne)return;const st=(de?.data?.items??[]).map(V=>({id:V.id,source:V.source,model:V.model,start:V.start,tokenLoad:V.freshInputTokens+V.cacheReadTokens+V.outputTokens}));L(st);const wt=st[0];wt&&!o&&l({source:wt.source,id:wt.id})}catch{ne&&L([])}finally{ne&&fe(!1)}})(),()=>{ne=!1}},[e,n,o]),g.useEffect(()=>{if(e!=="sessions")return;let ne=!0;return At(!0),dt(null),(async()=>{try{const de=await Pt.history.getSessions({filter:n,page:A,pageSize:20,sortBy:T,sortDir:k});if(!ne)return;de?.data?q(de.data):dt("Failed to load sessions")}catch(de){ne&&dt(Rs(de))}finally{ne&&At(!1)}})(),()=>{ne=!1}},[e,n,A,T,k]),g.useEffect(()=>{if(e!=="timeline")return;if(s==="session"&&!o){const de=ie[0];!Ee&&de&&l({source:de.source,id:de.id});return}let ne=!0;return qe(!0),Ke(null),(async()=>{try{const de=s==="session"&&o?await Pt.history.getTimeline({mode:"session",source:o.source,sessionId:o.id}):await Pt.history.getTimeline({mode:"consolidated",filter:n,...u.taskWbs?{taskWbs:u.taskWbs}:{},...u.runId?{runId:u.runId}:{}});if(!ne)return;de?.data?M(de.data):Ke("Failed to load timeline")}catch(de){ne&&Ke(Rs(de))}finally{ne&&qe(!1)}})(),()=>{ne=!1}},[e,s,o,n,Ee,ie,u]),g.useEffect(()=>{const ne=setTimeout(()=>{S(y)},250);return()=>clearTimeout(ne)},[y]),g.useEffect(()=>{if(e!=="tool-using")return;if(d==="session"&&!o){const de=ie[0];!Ee&&de&&l({source:de.source,id:de.id});return}let ne=!0;return le(!0),W(null),(async()=>{try{const de=d==="session"&&o?{mode:"session",source:o.source,sessionId:o.id,toolNames:f.length>0?f:void 0,status:b,search:v||void 0}:{mode:"consolidated",filter:n,toolNames:f.length>0?f:void 0,status:b,search:v||void 0},st=await Pt.history.getToolSequence(de);if(!ne)return;st?.data?H(st.data):W("Failed to load tool sequence")}catch(de){ne&&W(Rs(de))}finally{ne&&le(!1)}})(),()=>{ne=!1}},[e,d,o,n,f,b,v,Ee,ie]);const _e=(ne,de)=>{l({source:ne,id:de}),i("session"),t("timeline")},Be=(ne,de)=>{l({source:ne,id:de}),p("session")},ut=(ne,de)=>{const st=de?{source:de,id:ne}:j?.items.find(wt=>wt.id===ne)??ie.find(wt=>wt.id===ne);st&&_e(st.source,st.id)},mt=async ne=>(await Pt.history.triggerImport({mode:ne})).data,kt=te?"—":Y||C===void 0?"…":String(C.kpis.sessionsCount),yt=Ae?"—":Q||G===void 0?"…":String(G.scope.totalCalls),oe=ye?"—":he||re===void 0?"…":String(re.loops.length),Ne=Ye?"—":Pe||I===void 0?"…":String(I.agents.length),je={summary:null,timeline:null,"tool-using":yt,sessions:kt,insights:oe,sources:Ne},Ie=Ye?"—":Pe?"…":I?.overview.lastImportedAt?new Date(I.overview.lastImportedAt).toLocaleString():"never imported",gt=g.useMemo(()=>re?{count:re.loops.length,redundantCalls:re.loops.reduce((ne,de)=>ne+Math.max(0,de.repeats-1),0),wastedTokens:re.loops.reduce((ne,de)=>ne+de.wastedTokens,0)}:void 0,[re]),Ft=g.useMemo(()=>Wo(I?.agents.map(ne=>({id:ne.id,label:ne.name,color:ne.color}))??[],n.sources),[I?.agents,n.sources]),ve=g.useMemo(()=>Wo(C?.topModels.map(ne=>({id:ne.id,label:ne.label,color:ne.color}))??[],n.models),[C?.topModels,n.models]),He=g.useMemo(()=>Wo(C?.topTools.map(ne=>{const de=ne.id&&ne.id.trim()!==""?ne.id.trim():"unknown";return{id:de,label:de}})??[],n.tools?.map(ne=>ne&&ne.trim()!==""?ne.trim():"unknown")),[C?.topTools,n.tools]),$e=g.useMemo(()=>Wo(C?.skillsUsed.filter(ne=>ne.id&&ne.id.trim()!==""&&ne.id!=="unknown").map(ne=>({id:ne.id,label:ne.label,color:ne.color}))??[],n.skills?.filter(ne=>ne&&ne.trim()!==""&&ne!=="unknown")),[C?.skillsUsed,n.skills]),bt=g.useMemo(()=>({rangeLabel:tW(n),sessionCount:te?null:Y&&C===void 0?void 0:C?.kpis.sessionsCount,sourceCount:n.sources?.length??I?.agents.length}),[n,te,Y,C,I?.agents.length]);return a.jsxs("div",{className:"flex flex-col gap-4 p-4 max-w-[1600px] mx-auto w-full",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-base-content/10 pb-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl",children:"📊"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight",children:"Histories"}),a.jsx("p",{className:"text-xs text-base-content/60",children:"Transcript telemetry, session traces, and prompt cache analytics"}),a.jsxs("p",{className:"livechip mt-1 inline-flex items-center gap-1.5 rounded-full border border-base-content/10 px-2 py-0.5 text-xs text-base-content/60 font-mono","data-testid":"history-last-import",role:"status",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${Ye?"bg-error":"bg-emerald-400 animate-pulse"}`,"aria-hidden":"true"}),"last import ",Ie]})]})]}),a.jsx("div",{className:"flex items-center gap-1 bg-base-300 p-1 rounded-xl",children:eW.map(ne=>a.jsxs("button",{type:"button",className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${e===ne.id?"bg-primary text-primary-content font-bold shadow-sm":"text-base-content/70 hover:bg-base-content/10"}`,onClick:()=>t(ne.id),children:[ne.label,je[ne.id]!==null&&a.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 rounded-full text-[10px] font-mono bg-base-content/10","data-testid":`history-badge-${ne.id}`,children:je[ne.id]})]},ne.id))})]}),e!=="sources"&&a.jsx(kG,{filter:n,onChange:r,sourceOptions:Ft,modelOptions:ve,toolOptions:He,skillOptions:$e,scope:bt}),a.jsxs("div",{className:"mt-2",children:[e==="summary"&&a.jsx(wv,{data:C,loading:Y,error:te,dimension:n.dimension??"model",onDimensionChange:ne=>r(de=>({...de,dimension:ne})),bucket:n.bucket??"auto",onBucketChange:ne=>r(de=>({...de,bucket:ne})),loopSummary:gt}),e==="timeline"&&a.jsx(Av,{data:z,loading:Ot,error:De,mode:s,sessionId:o?.id,sessionSource:o?.source,availableSessions:ie,onSelectSession:_e,onModeChange:i,consolidatedTaskWbs:u.taskWbs,consolidatedRunId:u.runId,onConsolidatedScopeSubmit:c}),e==="tool-using"&&a.jsx(kv,{data:G,loading:Q,error:Ae,mode:d,onModeChange:p,sessionId:o?.id,sessionSource:o?.source,availableSessions:ie,onSelectSession:Be,toolNames:f,onToolNamesChange:m,status:b,onStatusChange:x,search:y,onSearchChange:E}),e==="sessions"&&a.jsx(Tv,{data:j,loading:Qe,error:ft,sortBy:T,sortDir:k,page:A,pageSize:20,onSortChange:ne=>{T===ne?F(de=>de==="asc"?"desc":"asc"):(w(ne),F("desc"))},onPageChange:N,onSelectSession:_e}),e==="insights"&&a.jsx(Sv,{data:re,loading:he,error:ye,cacheHitTrend:C?.kpiTrend??[],onSelectSession:ut}),e==="sources"&&a.jsx(Nv,{data:I,loading:Pe,error:Ye,onTriggerImport:mt})]})]})},rW={id:"history",name:"History",icon:"📊",route:"history",component:nW,sidebarLabel:"Histories",description:"Imported agent sessions, token analytics, and tool-call forensics",order:20},sW=Object.freeze(Object.defineProperty({__proto__:null,module:rW},Symbol.toStringTag,{value:"Module"})),aW=["30s","5m","1h","4h","24h","7d","all"],iW={"30s":3e4,"5m":5*6e4,"1h":60*6e4,"4h":240*6e4,"24h":1440*6e4,"7d":10080*6e4,all:null};function Uu(e,t=Date.now()){const n=iW[e];if(n!=null)return new Date(t-n).toISOString()}function oW({timeRange:e,onTimeRangeChange:t}){return a.jsxs("fieldset",{className:"flex items-center gap-1 bg-base-200 p-1 rounded-lg border-0 m-0","aria-label":"Time range presets",children:[a.jsx("legend",{className:"sr-only",children:"Time range presets"}),aW.map(n=>{const r=e===n;return a.jsx("button",{type:"button",onClick:()=>t(n),"aria-pressed":r,className:`px-2.5 py-1 text-xs font-semibold rounded-md transition-all cursor-pointer ${r?"bg-primary text-primary-content font-bold shadow-sm":"text-base-content/70 hover:bg-base-content/10"}`,children:n==="all"?"All":n},n)})]})}function lW(e){return e.selectedPrefixes.size>0||e.searchQuery.trim()!==""||e.searchScope!=="all"||e.severity!=="all"||e.tierFilter!=="all"||e.runId.trim()!==""}function zE({label:e,value:t,onChange:n,options:r}){return a.jsxs("fieldset",{className:"flex items-center gap-0.5 bg-base-100 border border-base-content/20 rounded-md p-0.5","aria-label":e,children:[a.jsx("legend",{className:"sr-only",children:e}),r.map(s=>{const i=s.value===t;return a.jsxs("label",{className:`flex-1 text-[11px] text-center px-2 py-0.5 rounded cursor-pointer transition-all ${i?"bg-primary text-primary-content font-bold shadow-xs":"text-base-content/70 hover:bg-base-content/10"}`,children:[a.jsx("input",{type:"radio",name:`segmented-${e}`,value:s.value,checked:i,onChange:()=>n(s.value),className:"sr-only"}),s.label]},s.value)})]})}const HE="Retention: events capped at 10,000 rows per prefix · terminal jobs pruned after 30d";function _v(){return a.jsxs("span",{"data-testid":"observability-retention-badge",className:"inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium rounded-lg border border-base-content/15 bg-base-100 text-base-content/70 whitespace-nowrap",title:HE,children:[a.jsx("span",{"aria-hidden":"true",children:"ℹ️"}),a.jsx("span",{children:HE})]})}function uW({filters:e,onFiltersChange:t,onClearFilters:n,prefixOptions:r,getPrefixColor:s,liveEnabled:i,onToggleLive:o,shownCount:l,totalCount:u,actions:c}){const d=g.useMemo(()=>{let m=0;return e.selectedPrefixes.size>0&&(m+=e.selectedPrefixes.size),e.searchQuery.trim()!==""&&(m+=1),e.severity!=="all"&&(m+=1),e.tierFilter!=="all"&&(m+=1),e.runId.trim()!==""&&(m+=1),m},[e]),p=lW(e),f=m=>{t(b=>{const x=new Set(b.selectedPrefixes);return x.has(m)?x.delete(m):x.add(m),{...b,selectedPrefixes:x}})};return a.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 p-3 bg-base-200/50 rounded-xl border border-base-content/10 shrink-0",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{"aria-live":"polite",className:"text-xs font-mono text-base-content/60 whitespace-nowrap","data-testid":"observability-result-count",children:[l," of ",u," shown"]}),a.jsxs("details",{className:"relative inline-block","data-testid":"observability-filter-disclosure",children:[a.jsxs("summary",{className:"px-2.5 py-1 text-xs font-medium rounded-lg border border-base-content/20 bg-base-200 text-base-content/80 hover:bg-base-300 transition-colors cursor-pointer list-none flex items-center gap-1.5 focus:outline-none focus:ring-2 focus:ring-primary/40","aria-label":"Toggle filter panel",children:[a.jsx("span",{children:"🔍 Filter"}),d>0&&a.jsx("span",{className:"px-1.5 py-0.2 rounded-full text-[10px] font-bold bg-primary text-primary-content",children:d})]}),a.jsxs("div",{className:"absolute right-0 top-full z-30 p-3 shadow-xl bg-base-200 border border-base-content/10 rounded-xl w-80 sm:w-96 mt-2 flex flex-col gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-base-content/10",children:[a.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-base-content/70",children:"Filters"}),p&&a.jsx("button",{type:"button",onClick:n,className:"text-xs text-error hover:underline cursor-pointer","aria-label":"Clear all filters",children:"Clear all"})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("label",{htmlFor:"filter-search-input",className:"text-[11px] font-semibold text-base-content/60",children:"Search"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("select",{value:e.searchScope,onChange:m=>t(b=>({...b,searchScope:m.target.value})),className:"bg-base-100 border border-base-content/20 rounded px-2 py-1 text-xs text-base-content focus:outline-none focus:ring-2 focus:ring-primary/40 cursor-pointer","aria-label":"Search scope",children:[a.jsx("option",{value:"all",children:"all"}),a.jsx("option",{value:"name",children:"name"}),a.jsx("option",{value:"actor",children:"actor"}),a.jsx("option",{value:"payload",children:"payload"})]}),a.jsx(Ii,{id:"filter-search-input",size:"sm",variant:"bordered",placeholder:`Search ${e.searchScope}…`,value:e.searchQuery,onChange:m=>t(b=>({...b,searchQuery:m.target.value})),className:"flex-1 input-xs","aria-label":`Search ${e.searchScope}`})]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[11px] font-semibold text-base-content/60",children:"Severity"}),a.jsx(zE,{label:"Severity",value:e.severity,onChange:m=>t(b=>({...b,severity:m})),options:[{value:"all",label:"All"},{value:"info",label:"Info"},{value:"warning",label:"Warning"},{value:"error",label:"Error"}]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[11px] font-semibold text-base-content/60",children:"Tier"}),a.jsx(zE,{label:"Tier",value:e.tierFilter,onChange:m=>t(b=>({...b,tierFilter:m})),options:[{value:"all",label:"All"},{value:"default",label:"Default"},{value:"diagnostic",label:"Diagnostic"}]})]}),r.length>0&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[11px] font-semibold text-base-content/60",children:"Prefix"}),a.jsxs("fieldset",{className:"flex flex-wrap items-center gap-1.5 border-0 p-0 m-0","aria-label":"Filter by prefix",children:[a.jsx("legend",{className:"sr-only",children:"Filter by prefix"}),r.map(m=>{const b=e.selectedPrefixes.has(m),x=s(m);return a.jsxs("button",{type:"button",role:"switch","aria-checked":b,"aria-label":`Prefix ${m}${b?" (selected)":""}`,onClick:()=>f(m),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border transition-colors cursor-pointer ${b?`${x} border-current bg-base-100 font-bold`:"text-base-content/60 border-base-content/20 hover:bg-base-100"}`,children:[m,".*"]},m)})]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("label",{htmlFor:"filter-run-id-input",className:"text-[11px] font-semibold text-base-content/60",children:"Run ID"}),a.jsx(Ii,{id:"filter-run-id-input",size:"sm",variant:"bordered",placeholder:"Filter by run id…",value:e.runId,onChange:m=>t(b=>({...b,runId:m.target.value})),className:"w-full input-xs","aria-label":"Filter by run id"})]})]})]}),a.jsx(_v,{}),a.jsx("button",{type:"button",onClick:o,className:`px-2.5 py-1 text-xs font-semibold rounded-lg border transition-all cursor-pointer flex items-center gap-1.5 ${i?"border-emerald-500/40 bg-emerald-500/10 text-emerald-500 hover:bg-emerald-500/20":"border-amber-500/40 bg-amber-500/10 text-amber-500 hover:bg-amber-500/20"}`,"aria-label":i?"Pause live event stream":"Resume live event stream","aria-pressed":i,children:a.jsx("span",{children:i?"⏸ Pause Live":"▶ Resume Live"})}),c]})})}const Qs=[{key:"time",label:"Time",description:"Event timestamp",defaultVisible:!0,sortable:!0,colWidth:"w-36"},{key:"severity",label:"Severity",description:"Diagnostic severity level",defaultVisible:!0,sortable:!0,colWidth:"w-24"},{key:"event",label:"Event",description:"Event name with domain prefix",defaultVisible:!0,sortable:!0,colWidth:"w-[15%]"},{key:"summary",label:"Summary",description:"Rendered human summary",defaultVisible:!0,sortable:!0,colWidth:"w-[20%]"},{key:"correlation",label:"Correlation",description:"Entity or run correlation identifier",defaultVisible:!0,sortable:!0,colWidth:"w-[16%]"},{key:"outcome",label:"Outcome",description:"Execution result or state change",defaultVisible:!0,sortable:!0,colWidth:"w-28"},{key:"agent",label:"Agent",description:"Target or actor agent role",defaultVisible:!0,sortable:!0,colWidth:"w-28"},{key:"producer",label:"Producer",description:"Subsystem or source package",defaultVisible:!1,sortable:!1,colWidth:"w-[16%]"},{key:"action",label:"Action",description:"Action link or remediation command",defaultVisible:!1,sortable:!1,colWidth:"w-[15%]"},{key:"actor",label:"Actor",description:"Originating user or system actor",defaultVisible:!1,sortable:!1,colWidth:"w-24"}],cW=new Set(Qs.map(e=>e.key)),Fr=["time","severity","event","summary","correlation","outcome","agent"],Cv="spur:observability:columns:v1";function dW(e){if(!Array.isArray(e)||e.length===0)return[...Fr];const t=new Set;for(const n of e)typeof n=="string"&&cW.has(n)&&t.add(n);return t.size===0?[...Fr]:Qs.filter(n=>t.has(n.key)).map(n=>n.key)}function pW(e){try{const t=e??(typeof window<"u"?window.localStorage:void 0);if(!t)return[...Fr];const n=t.getItem(Cv);if(!n)return[...Fr];const r=JSON.parse(n);return dW(r)}catch{return[...Fr]}}function GE(e,t){try{const n=t??(typeof window<"u"?window.localStorage:void 0);if(!n)return;n.setItem(Cv,JSON.stringify(e))}catch{}}function fW({visibleColumns:e,onVisibleColumnsChange:t}){const n=g.useMemo(()=>new Set(e),[e]),r=i=>{const o=new Set(n);if(o.has(i)){if(o.size<=1)return;o.delete(i)}else o.add(i);const l=Qs.filter(u=>o.has(u.key)).map(u=>u.key);t(l),GE(l)},s=()=>{const i=[...Fr];t(i),GE(i)};return a.jsxs("details",{className:"relative inline-block","data-testid":"observability-column-customizer",children:[a.jsxs("summary",{className:"px-2.5 py-1 text-xs font-medium rounded-lg border border-base-content/20 bg-base-200 text-base-content/80 hover:bg-base-300 transition-colors cursor-pointer list-none flex items-center gap-1.5 focus:outline-none focus:ring-2 focus:ring-primary/40","aria-label":"Customize visible columns",children:[a.jsx("span",{children:"📊 Columns"}),a.jsxs("span",{className:"text-[10px] text-base-content/60 font-mono",children:["(",e.length,"/",Qs.length,")"]})]}),a.jsxs("div",{className:"absolute right-0 top-full z-30 p-3 shadow-xl bg-base-200 border border-base-content/10 rounded-xl w-64 mt-2 flex flex-col gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-base-content/10",children:[a.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-base-content/70",children:"Columns"}),a.jsx("button",{type:"button",onClick:s,className:"text-xs text-primary hover:underline cursor-pointer","aria-label":"Reset columns to default",children:"Reset defaults"})]}),a.jsxs("fieldset",{className:"flex flex-col gap-1.5 border-0 p-0 m-0","aria-label":"Visible columns",children:[a.jsx("legend",{className:"sr-only",children:"Select visible columns"}),Qs.map(i=>{const o=n.has(i.key),l=o&&n.size===1,u=`observability-col-${i.key}`;return a.jsxs("label",{htmlFor:u,className:`flex items-center justify-between px-2 py-1 rounded-md text-xs transition-colors ${l?"opacity-60 cursor-not-allowed":"hover:bg-base-100 cursor-pointer text-base-content/90"}`,children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Mb,{id:u,size:"xs",variant:"primary",checked:o,disabled:l,onChange:()=>r(i.key),"aria-label":i.label}),a.jsx("span",{className:"font-medium",children:i.label})]}),i.defaultVisible&&a.jsx("span",{className:"text-[10px] text-base-content/50 uppercase",children:"default"})]},i.key)})]})]})]})}const mW=()=>`${nt()}/events/planning`,Zd=100;function Xd(e){const t=`${nt()}/events/history`,n=[],r=e.limit??Zd;return n.push(`limit=${r}`),e.prefix&&n.push(`prefix=${encodeURIComponent(e.prefix)}`),e.names&&n.push(`names=${encodeURIComponent(e.names)}`),e.actor&&n.push(`actor=${encodeURIComponent(e.actor)}`),e.runId&&n.push(`runId=${encodeURIComponent(e.runId)}`),e.since&&n.push(`since=${encodeURIComponent(e.since)}`),e.cursor&&n.push(`cursor=${encodeURIComponent(e.cursor)}`),`${t}?${n.join("&")}`}const hW={workflow:"text-cyan-400",task:"text-emerald-400",feature:"text-emerald-400",agent:"text-amber-400",rule:"text-rose-400",message:"text-sky-400",process:"text-violet-400",queue:"text-orange-400",bus:"text-pink-400",api:"text-teal-400"},WE="text-spur-text-muted";function Iv(e){return e?hW[e]??WE:WE}const qc={selectedPrefixes:new Set,searchQuery:"",searchScope:"all",severity:"all",tierFilter:"all",runId:""};function gW(){const e=g.useRef([]),[t,n]=g.useState(0);g.useEffect(()=>{const s=window.setInterval(()=>{const i=Date.now()-6e4,o=e.current.filter(l=>l>=i);e.current=o,n(o.length)},1e3);return()=>window.clearInterval(s)},[]);const r=g.useCallback(()=>{const s=Date.now(),i=s-6e4,o=e.current.filter(l=>l>=i);o.push(s),e.current=o,n(o.length)},[]);return{rate:t,recordEvent:r}}function Qd(e){if(e===null||typeof e!="object"||!("events"in e)||!("count"in e))return null;const t=e.events;if(!Array.isArray(t))return null;const n=e.count;if(typeof n!="number")return null;const r=e.nextCursor,s=typeof r=="string"?r:null,i=e.hasMore,o=typeof i=="boolean"?i:!1,l=[];for(const d of t){const p=bW(d);p&&l.push(p)}const u=e.catalog,c=Array.isArray(u)?xW(u):void 0;return{events:l,count:n,nextCursor:s,hasMore:o,...c?{catalog:c}:{}}}function bW(e){if(e===null||typeof e!="object")return null;const t=e;if(typeof t.id!="string"||typeof t.eventName!="string"||typeof t.occurredAt!="string")return null;const n=typeof t.prefix=="string"?t.prefix:void 0,r=typeof t.renderer=="string"?t.renderer:void 0,s=t.actor;if(s!==null&&typeof s!="string")return null;const i=t.payload,o=typeof t.runId=="string"?t.runId:t.runId===null?null:void 0,l=typeof t.entityKind=="string"?t.entityKind:t.entityKind===null?null:void 0,u=typeof t.entityId=="string"?t.entityId:t.entityId===null?null:void 0,c=typeof t.sequence=="number"&&Number.isFinite(t.sequence)?t.sequence:t.sequence===null?null:void 0,d={id:t.id,eventName:t.eventName,occurredAt:t.occurredAt,actor:s,...n?{prefix:n}:{},...r?{renderer:r}:{}};if(i===null)return{...d,payload:null,view:cs(t.eventName,null),...jl(o,l,u,c)};if(typeof i!="object")return null;const p=i,f=p.schemaVersion===2?p:void 0;return{...d,payload:Rv(p),...f?{envelope:f}:{},view:cs(t.eventName,p),...jl(o,l,u,c)}}function jl(e,t,n,r){const s={};return e!==void 0&&(s.runId=e),t!==void 0&&(s.entityKind=t),n!==void 0&&(s.entityId=n),r!==void 0&&(s.sequence=r),s}function xW(e){const t=[];for(const n of e){if(n===null||typeof n!="object")return;const r=n;if(typeof r.name!="string"||typeof r.prefix!="string"||typeof r.source!="string"||typeof r.renderer!="string")return;const s=typeof r.tier=="string"?r.tier:void 0,i={name:r.name,prefix:r.prefix,source:r.source,renderer:r.renderer,...s!==void 0?{tier:s}:{}};t.push(i)}return t}function yW(e){if(e===null||typeof e!="object")return null;const t=e;if(typeof t.eventName!="string"||t.eventName.length===0||typeof t.occurredAt!="string")return null;const n=typeof t.prefix=="string"?t.prefix:void 0,r=typeof t.renderer=="string"?t.renderer:void 0,s=t.actor;if(s!==null&&typeof s!="string")return null;const i=t.payload;if(i!==null&&typeof i!="object")return null;const o=i,l=o?.schemaVersion===2?o:void 0,u=Rv(o),c=t.runId??u?.runId,d=t.entityKind??u?.entityKind,p=t.entityId??u?.entityId,f=t.sequence??u?.sequence,m=typeof c=="string"?c:c===null?null:void 0,b=typeof d=="string"?d:d===null?null:void 0,x=typeof p=="string"?p:p===null?null:void 0,y=typeof f=="number"&&Number.isFinite(f)?f:f===null?null:void 0;return{eventName:t.eventName,occurredAt:t.occurredAt,actor:s,...n?{prefix:n}:{},...r?{renderer:r}:{},payload:u,...l?{envelope:l}:{},view:cs(t.eventName,o),...jl(m,b,x,y)}}function cs(e,t){const n=EW(e);if(t?.schemaVersion!==2)return n;const r=Ir(t.context),s=Ir(t.presentation),i=Ir(r?.project),o=Ir(r?.producer),l=Ir(r?.correlation);if(!r||!s||!i||!o||!l)return n;const u=s.severity==="info"||s.severity==="warning"||s.severity==="error"?s.severity:"warning",c=Array.isArray(s.fields)?s.fields.flatMap(v=>{const S=Ir(v),A=en(S?.label,64),N=en(S?.value,256);return A&&N?[{label:A,value:N}]:[]}).slice(0,8):[],d=[],p=(v,S)=>{const A=en(S,128);A&&d.push({label:v,value:A})};p("Run",l.runId),p("Execution",l.executionId),p("Action",l.actionId),p("Entity",TW(l.entityKind,l.entityId)),p("Job",l.jobId),typeof l.sequence=="number"&&Number.isFinite(l.sequence)&&d.push({label:"Sequence",value:String(l.sequence)});const f=en(o.package,128)??"unavailable",m=en(o.subsystem,128),b=SW(s.action),x=en(s.actionLabel,128)??"unavailable",y=en(s.agent,128),E=en(s.correlators,512);return{severity:u,summary:en(s.summary,512)??"unavailable",description:en(s.description,512)??"Description unavailable.",fields:c,projectName:en(i.name,128)??"unavailable",projectRoot:en(i.root,256)??"unavailable",producer:m?`${f} / ${m}`:f,correlation:E??"unavailable",correlationFields:d,outcome:en(s.outcome,128)??"unavailable",action:b,actionLabel:x,agent:y}}function EW(e){return{severity:"warning",summary:"unavailable",description:`Canonical context unavailable for ${en(e,128)??"unknown"}.`,fields:[],projectName:"unavailable",projectRoot:"unavailable",producer:"unavailable",correlation:"unavailable",correlationFields:[],outcome:"unavailable",action:null,actionLabel:"unavailable",agent:null}}function SW(e){const t=Ir(e);if(!t||t.kind!=="command"&&t.kind!=="filter"&&t.kind!=="path")return null;const n=en(t.label,128),r=en(t.value,256);return n&&r?{label:n,kind:t.kind,value:r}:null}function en(e,t){return typeof e!="string"||e.length===0?null:e.length<=t?e:`${e.slice(0,t-1)}…`}function TW(e,t){const n=en(e,64),r=en(t,128);return n&&r?`${n}:${r}`:n??r}const NW=["Entity","Run","Execution","Action","Job"];function wW(e,t){for(const n of NW){const r=t.correlationFields.find(s=>s.label===n);if(r!==void 0&&r.value!=="")return`${e.eventName} · ${r.value}`}return e.id!==""&&!e.id.startsWith("live-")?`${e.eventName} · ${e.id}`:e.eventName}function Ir(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Rv(e){return e?.schemaVersion!==2?e:Ir(e.data)}const vW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function qE(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=vW[t.getMonth()],r=t.getDate(),s=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${n} ${r} ${s}:${i}:${o}`}function Dv(e){return typeof e!="number"||!Number.isFinite(e)?null:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function ht(e){return e&&e!=="unavailable"?e:"-"}function AW(e,t){const n={};e.selectedPrefixes&&e.selectedPrefixes.size===1&&(n.prefix=[...e.selectedPrefixes][0]);const r=e.searchQuery?.trim()??"";r!==""&&e.searchScope==="name"&&(n.names=r),r!==""&&e.searchScope==="actor"&&(n.actor=r),e.runId&&e.runId.trim()!==""&&(n.runId=e.runId.trim());const s=Uu(t);return s&&(n.since=s),n}function VE(e,t,n){if(t.selectedPrefixes.size>=1){const r=e.prefix??e.eventName.split(".")[0]??e.eventName;if(!t.selectedPrefixes.has(r))return!1}if(t.tierFilter!=="all"){const r=n.get(e.eventName);if(r!==t.tierFilter&&!(t.tierFilter==="default"&&r===void 0))return!1}if(t.severity!=="all"&&(e.view??cs(e.eventName,e.payload??null)).severity!==t.severity)return!1;if(t.searchQuery.trim()!==""){const r=t.searchQuery.toLowerCase();let s=!1;if((t.searchScope==="name"||t.searchScope==="all")&&(s=s||e.eventName.toLowerCase().includes(r)),(t.searchScope==="actor"||t.searchScope==="all")&&(s=s||(e.actor?.toLowerCase().includes(r)??!1)),t.searchScope==="payload"&&e.payload&&(s=s||JSON.stringify(e.payload).toLowerCase().includes(r)),!s)return!1}return!(t.runId.trim()!==""&&e.runId!==t.runId.trim())}const sx={key:"time",direction:"desc"};function kW(e,t=sx){const n=e.map((r,s)=>({row:r,idx:s}));return n.sort((r,s)=>{let i=0;const o=r.row.view??cs(r.row.eventName,r.row.payload??null),l=s.row.view??cs(s.row.eventName,s.row.payload??null);switch(t.key){case"time":{const u=Date.parse(r.row.occurredAt),c=Date.parse(s.row.occurredAt),d=Number.isNaN(u)?-1/0:u,p=Number.isNaN(c)?-1/0:c;i=d-p;break}case"severity":{const u=c=>c==="info"?0:c==="warning"?1:2;i=u(o.severity)-u(l.severity);break}case"event":{i=r.row.eventName.localeCompare(s.row.eventName);break}case"summary":{i=(o.summary??"").localeCompare(l.summary??"");break}case"correlation":{i=(o.correlation??"").localeCompare(l.correlation??"");break}case"agent":{i=(o.agent??"").localeCompare(l.agent??"");break}case"outcome":{i=(o.outcome??"").localeCompare(l.outcome??"");break}default:i=0}return i!==0?t.direction==="asc"?i:-i:r.idx-s.idx}),n.map(r=>r.row)}function qo({value:e,label:t}){const[n,r]=g.useState("idle"),s=async i=>{i.preventDefault(),i.stopPropagation();try{typeof navigator<"u"&&navigator.clipboard?.writeText?(await navigator.clipboard.writeText(e),r("copied"),setTimeout(()=>r("idle"),1500)):(r("failed"),setTimeout(()=>r("idle"),2e3))}catch{r("failed"),setTimeout(()=>r("idle"),2e3)}};return!e||e==="-"||e==="unavailable"?null:a.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center justify-center p-0.5 rounded text-base-content/40 hover:text-base-content hover:bg-base-content/10 transition-colors cursor-pointer shrink-0 text-[10px] focus:outline-none focus:ring-1 focus:ring-primary/40",title:n==="copied"?"Copied":n==="failed"?"Copy failed":`Copy ${t}`,"aria-label":n==="copied"?`Copied ${t}`:n==="failed"?`Copy ${t} failed`:`Copy ${t}`,children:[a.jsx("span",{"aria-hidden":"true",children:n==="copied"?"✓":n==="failed"?"!":"📋"}),a.jsx("span",{className:"sr-only","aria-live":"polite",children:n==="copied"?`${t} copied`:n==="failed"?`${t} copy failed`:""})]})}function _W({onLivenessChange:e,timeRange:t}){const[n,r]=g.useState(()=>pW()),[s,i]=g.useState(sx),o=g.useCallback(fe=>{i(Y=>Y.key===fe?{key:fe,direction:Y.direction==="asc"?"desc":"asc"}:{key:fe,direction:"asc"})},[]),[l,u]=g.useState(!0),[c,d]=g.useState([]),[p,f]=g.useState([]),[m,b]=g.useState("idle"),[x,y]=g.useState(null),[E,v]=g.useState(null),[S,A]=g.useState(!1),[N,T]=g.useState(!1),[w,k]=g.useState(qc),[F,C]=g.useState(qc),[$,z]=g.useState("connecting"),{rate:M,recordEvent:G}=gW();g.useEffect(()=>{e?.({status:l?$:"paused",rate:M,lastEventAt:c[0]?.occurredAt??null})},[l,$,M,c,e]);const H=g.useMemo(()=>{const fe=new Map;for(const Y of p)Y.tier&&fe.set(Y.name,Y.tier);return fe},[p]);g.useEffect(()=>{const fe=window.setTimeout(()=>{C(w)},250);return()=>window.clearTimeout(fe)},[w]);const j=g.useMemo(()=>AW(F,t),[F,t]),q=g.useRef(0);g.useEffect(()=>{const fe=++q.current,Y=new AbortController;return b("loading"),y(null),(async()=>{try{const me=await Ge(new Request(Xd({...j,limit:Zd}),{signal:Y.signal}));if(!me.ok){const he=await me.json().catch(()=>null),be=he?.code;throw be==="UNKNOWN_PREFIX"||be==="MALFORMED_CURSOR"?new Error(`${be}: ${he.error??me.status}`):new Error(`history fetch failed: ${me.status}`)}const te=await me.json(),O=Qd(te);if(!O)throw new Error("history response failed schema validation");if(fe!==q.current)return;d(O.events),O.catalog&&f(O.catalog),v(O.nextCursor),A(O.hasMore),b("loaded")}catch(me){if(Y.signal.aborted||fe!==q.current)return;y(me instanceof Error?me.message:String(me)),b("error")}})(),()=>Y.abort()},[j]);const re=g.useCallback(async()=>{if(!(!S||N||E===null)){T(!0);try{const fe=await Ge(new Request(Xd({...j,limit:Zd,cursor:E})));if(!fe.ok)throw new Error(`history fetch failed: ${fe.status}`);const Y=await fe.json(),me=Qd(Y);if(!me)throw new Error("history response failed schema validation");d(te=>{const O=new Set(te.map(be=>be.id)),he=me.events.filter(be=>!O.has(be.id));return[...te,...he]}),me.catalog&&f(me.catalog),v(me.nextCursor),A(me.hasMore)}catch(fe){y(fe instanceof Error?fe.message:String(fe))}finally{T(!1)}}},[S,N,E,j]),pe=g.useRef(w);pe.current=w;const I=g.useRef(H);I.current=H,g.useEffect(()=>{if(!l||typeof EventSource>"u")return;z("connecting");const fe=new EventSource(mW());return fe.onopen=()=>{z("live")},fe.onerror=()=>{z("errored")},fe.onmessage=Y=>{try{const me=JSON.parse(Y.data),te=yW(me);if(!te||te.eventName==="connected")return;const O=pe.current,he=I.current;if(!VE({eventName:te.eventName,occurredAt:te.occurredAt,actor:te.actor,...te.prefix?{prefix:te.prefix}:{},payload:te.payload,view:te.view,...te.runId!==void 0?{runId:te.runId}:{}},O,he))return;const be={id:`live-${te.occurredAt}-${te.eventName}`,eventName:te.eventName,occurredAt:te.occurredAt,actor:te.actor,...te.prefix?{prefix:te.prefix}:{},...te.renderer?{renderer:te.renderer}:{},payload:te.payload,...te.envelope?{envelope:te.envelope}:{},view:te.view,...jl(te.runId,te.entityKind,te.entityId,te.sequence)};d(ye=>[be,...ye]),G()}catch{}},()=>fe.close()},[l,G]);const Z=g.useMemo(()=>Array.from(new Set([...p.map(fe=>fe.prefix),...c.map(fe=>fe.prefix??fe.eventName.split(".")[0]??fe.eventName)])).sort(),[p,c]),ie=g.useCallback(()=>{k(qc)},[]),L=g.useMemo(()=>c.filter(fe=>VE(fe,w,H)),[c,w,H]),Ee=g.useMemo(()=>kW(L,s),[L,s]);return m==="error"?a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load event history: ",x]}):m==="idle"||m==="loading"?a.jsxs("div",{className:"flex items-center justify-center h-32 text-spur-text-muted text-sm",children:[a.jsx(Ss,{size:"sm"})," Loading event history…"]}):a.jsxs("div",{className:"flex flex-col gap-4","data-system-events-tab":!0,children:[a.jsx(uW,{filters:w,onFiltersChange:k,onClearFilters:ie,prefixOptions:Z,getPrefixColor:Iv,liveEnabled:l,onToggleLive:()=>u(fe=>!fe),shownCount:L.length,totalCount:c.length,actions:a.jsx(fW,{visibleColumns:n,onVisibleColumnsChange:r})}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 overflow-hidden flex flex-col",children:[Ee.length===0?a.jsx("div",{className:"p-8 text-sm text-spur-text-muted italic text-center",children:c.length===0?"No system events yet. New events from the planning bus will appear here in real time.":"No events match the active filters."}):a.jsx(IW,{rows:Ee,catalog:p,visibleColumns:n,sortState:s,onSortChange:o}),S&&a.jsx("div",{className:"px-4 py-2 border-t border-base-content/10 bg-base-200/50 shrink-0 flex justify-center",children:a.jsx("button",{type:"button",onClick:re,disabled:N,"data-load-older":!0,className:"text-[11px] text-spur-text-muted hover:text-spur-text px-3 py-1 rounded border border-spur-border/40 hover:border-spur-text/40 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait focus:outline-none focus:ring-2 focus:ring-spur-text/40",children:N?"Loading…":"Load older"})})]})]})}function CW(e){const[t,n]=g.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(e).matches);return g.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const r=window.matchMedia(e),s=i=>n(i.matches);return r.addEventListener("change",s),n(r.matches),()=>r.removeEventListener("change",s)},[e]),t}function IW({rows:e,catalog:t,visibleColumns:n=Fr,sortState:r=sx,onSortChange:s=()=>{}}){const i=g.useMemo(()=>{const u=new Map;for(const c of t)c.tier&&u.set(c.name,c.tier);return u},[t]),o=CW("(max-width: 639px)"),l=g.useMemo(()=>new Map(Qs.map(u=>[u.key,u])),[]);return a.jsx("section",{className:"overflow-x-auto min-w-0","data-system-events-tab":!0,"aria-label":"System events",children:a.jsxs("table",{className:`w-full ${o?"min-w-0":"min-w-[1000px]"} text-xs border-separate border-spacing-0 table-fixed`,children:[a.jsx("colgroup",{children:o?a.jsxs(a.Fragment,{children:[a.jsx("col",{className:"w-24"}),a.jsx("col",{className:"w-full"})]}):n.map(u=>a.jsx("col",{className:l.get(u)?.colWidth??"w-24"},u))}),a.jsx("thead",{className:"sticky top-0 z-10 bg-base-200",children:a.jsx("tr",{className:"text-left text-spur-text-muted uppercase tracking-wide text-[10px]",children:o?a.jsxs(a.Fragment,{children:[a.jsx("th",{scope:"col",className:"font-semibold px-3 py-1.5 border-b border-spur-border",children:"Time"}),a.jsx("th",{scope:"col",className:"font-semibold px-3 py-1.5 border-b border-spur-border",children:"Event"})]}):n.map(u=>{const c=l.get(u);if(!c)return null;const d=r.key===u,p=d?r.direction==="asc"?" ▲":" ▼":"",f=d?r.direction==="asc"?"ascending":"descending":"none";return c.sortable?a.jsx("th",{scope:"col","aria-sort":f,className:"font-semibold px-3 py-1.5 border-b border-spur-border select-none",children:a.jsxs("button",{type:"button",onClick:()=>s(u),className:"flex items-center gap-1 uppercase tracking-wide text-[10px] font-semibold text-spur-text-muted hover:text-spur-text transition-colors cursor-pointer bg-transparent border-0 p-0 focus:outline-none focus:ring-1 focus:ring-primary/40 rounded",children:[a.jsx("span",{children:c.label}),p&&a.jsx("span",{"aria-hidden":"true",children:p})]})},u):a.jsx("th",{scope:"col",className:"font-semibold px-3 py-1.5 border-b border-spur-border",children:c.label},u)})})}),a.jsx("tbody",{children:e.map(u=>a.jsx(RW,{event:u,tier:i.get(u.eventName)??"default",compact:o,visibleColumns:n},u.id))})]})})}const Vc="system-events-payload-tooltip-pin";function Yc({severity:e}){const t=g.useMemo(()=>{switch(e){case"error":return{icon:"✕",badgeClass:"bg-error/15 text-error border-error/30"};case"warning":return{icon:"▲",badgeClass:"bg-warning/15 text-warning border-warning/30"};default:return{icon:"●",badgeClass:"bg-base-content/10 text-base-content/70 border-base-content/20"}}},[e]);return a.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[10px] font-semibold border ${t.badgeClass} whitespace-nowrap`,children:[a.jsx("span",{"aria-hidden":"true",children:t.icon}),a.jsx("span",{children:e})]})}function RW({event:e,tier:t,compact:n,visibleColumns:r=Fr}){const s=e.prefix??e.eventName.split(".")[0]??e.eventName,i=g.useMemo(()=>e.view??cs(e.eventName,e.payload??null),[e.eventName,e.payload,e.view]),o=Iv(s),[l,u]=g.useState(!1),[c,d]=g.useState(!1),[p,f]=g.useState(!1),[m,b]=g.useState(null),x=g.useRef(null),y=g.useRef(null),E=g.useRef(0),v=g.useRef(null),S=ht(e.actor),A=c||p,N=g.useCallback(()=>{v.current!==null&&(clearTimeout(v.current),v.current=null)},[]),T=g.useCallback(()=>{f(!1),b(null)},[]),w=g.useCallback((M,G)=>{E.current=performance.now()+400,f(!0),d(!1),N();const H=Number.isFinite(M)&&M>0?M:8,j=Number.isFinite(G)&&G>0?G:8;b({x:H,y:j}),window.dispatchEvent(new CustomEvent(Vc,{detail:{id:e.id}}))},[e.id,N]),k=g.useCallback((M,G,H)=>{const j=M.getBoundingClientRect(),q=G&&G>0?G:j.left,re=H&&H>0?H+4:j.bottom+6;w(q,re)},[w]);g.useEffect(()=>{const M=G=>{G.detail?.id!==e.id&&T()};return window.addEventListener(Vc,M),()=>window.removeEventListener(Vc,M)},[e.id,T]),g.useEffect(()=>{if(!p)return;const M=H=>{performance.now()<E.current||x.current?.contains(H.target)||y.current?.contains(H.target)||T()},G=H=>{H.key==="Escape"&&(T(),H.stopPropagation())};return document.addEventListener("pointerdown",M,!0),document.addEventListener("keydown",G,!0),()=>{document.removeEventListener("pointerdown",M,!0),document.removeEventListener("keydown",G,!0)}},[p,T]),g.useEffect(()=>()=>{N()},[N]);const F=g.useCallback(()=>u(M=>!M),[]),C=g.useCallback(M=>{if(M.key==="Escape"){if(p){T(),M.stopPropagation();return}u(!1),M.stopPropagation()}},[p,T]),$=A?a.jsxs("div",{ref:x,id:`system-event-tooltip-${e.id}`,role:"tooltip","data-testid":"system-event-payload-tooltip","data-pinned":p?"true":"false",className:p?"pointer-events-auto fixed z-50 rounded shadow-lg p-2.5 text-[11px] min-w-[min(400px,90vw)] max-w-[min(840px,95vw)] whitespace-normal border border-[#30363d] bg-[#0d1117] text-[#c9d1d9] select-text cursor-text":"pointer-events-auto absolute left-0 top-full mt-1 z-30 rounded shadow-lg p-2.5 text-[11px] min-w-[min(400px,90vw)] max-w-[min(840px,95vw)] whitespace-normal border border-[#30363d] bg-[#0d1117] text-[#c9d1d9]",style:p&&m?{top:m.y,left:m.x}:void 0,onMouseEnter:()=>{N(),d(!0)},onMouseLeave:()=>{p||(N(),v.current=setTimeout(()=>d(!1),150))},onFocusCapture:()=>d(!0),onBlurCapture:M=>{!p&&!M.currentTarget.contains(M.relatedTarget)&&d(!1)},onPointerDown:M=>{p&&M.stopPropagation()},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[a.jsx("div",{className:"text-[11px] font-sans font-semibold text-[#c9d1d9] truncate","data-testid":"system-event-tooltip-title",children:wW(e,i)}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[!p&&a.jsx("button",{type:"button","data-testid":"system-event-payload-tooltip-pin",className:"text-[10px] text-[#c9d1d9] hover:text-white px-1.5 py-0.5 rounded border border-[#30363d] bg-[#21262d] cursor-pointer",onClick:M=>{M.stopPropagation(),M.preventDefault();const G=y.current;G?k(G):w(M.clientX,M.clientY)},children:"Pin"}),p&&a.jsx("button",{type:"button","data-testid":"system-event-payload-tooltip-close",className:"text-[10px] text-[#8b949e] hover:text-[#c9d1d9] px-1 rounded border border-[#30363d] cursor-pointer",onClick:M=>{M.stopPropagation(),T()},children:"close"})]})]}),a.jsx("p",{className:"mb-2 text-spur-text leading-relaxed","data-testid":"system-event-description",children:i.description}),a.jsxs("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 max-h-80 overflow-y-auto",children:[a.jsx("dt",{className:"text-spur-text-muted",children:"Summary"}),a.jsx("dd",{className:"break-words",children:ht(i.summary)}),a.jsx("dt",{className:"text-spur-text-muted",children:"Severity"}),a.jsx("dd",{children:a.jsx(Yc,{severity:i.severity})}),i.fields.map(M=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"text-spur-text-muted",children:M.label}),a.jsx("dd",{className:"font-mono break-all",children:ht(M.value)})]},M.label+M.value)),a.jsx("dt",{className:"text-spur-text-muted",children:"Producer"}),a.jsx("dd",{className:"font-mono break-all",children:ht(i.producer)}),i.correlationFields.length>0?i.correlationFields.map(M=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"text-spur-text-muted",children:M.label}),a.jsx("dd",{className:"font-mono break-all",children:ht(M.value)})]},`correlation-${M.label}`)):a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-spur-text-muted",children:"Correlation"}),a.jsx("dd",{className:"font-mono",children:"-"})]}),a.jsx("dt",{className:"text-spur-text-muted",children:"Outcome"}),a.jsx("dd",{className:"font-mono break-all",children:ht(i.outcome)})]}),i.action&&a.jsxs("div",{className:"mt-2 border-t border-[#30363d] pt-2","data-testid":"system-event-remediation",children:[a.jsx("div",{className:"text-spur-text-muted",children:i.action.label}),a.jsx("code",{className:"block mt-0.5 font-mono break-all select-text",children:i.action.value})]}),a.jsx("div",{className:"mt-2 border-t border-[#30363d] pt-1.5 text-[10px] text-[#8b949e] font-sans","data-testid":"system-event-tooltip-footer",children:p?"Select to copy · Esc or outside click to close":"Click event name or Pin to lock for copy"})]}):null,z=M=>{switch(M){case"time":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-spur-text-muted whitespace-nowrap align-middle",children:qE(e.occurredAt)},"time");case"severity":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 align-middle text-[10px]",children:a.jsx(Yc,{severity:i.severity})},"severity");case"event":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 relative align-middle min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("button",{type:"button","aria-expanded":l,"aria-controls":`detail-${e.id}`,"aria-label":`${l?"Collapse":"Expand"} detail for ${e.eventName}`,onClick:F,onKeyDown:C,className:"inline-flex items-center justify-center w-4 h-4 text-spur-text-muted hover:text-spur-text text-[10px] transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-spur-text/40 shrink-0",children:l?"▾":"▸"}),a.jsxs("div",{className:"relative min-w-0 max-w-full flex items-center gap-1",children:[a.jsx("button",{ref:y,type:"button",className:`font-mono font-semibold truncate block max-w-full text-left cursor-pointer bg-transparent border-0 p-0 ${o}`,"data-testid":"system-event-name","aria-label":`Context for ${e.eventName}. Hover to preview; click to pin for select and copy.`,"aria-describedby":A?`system-event-tooltip-${e.id}`:void 0,onMouseEnter:()=>{N(),d(!0)},onFocus:()=>{N(),d(!0)},onBlur:G=>{!p&&!x.current?.contains(G.relatedTarget)&&d(!1)},onMouseLeave:()=>{N(),v.current=setTimeout(()=>{p||d(!1)},200)},onClick:G=>{G.preventDefault(),G.stopPropagation(),!p&&k(G.currentTarget,G.clientX,G.clientY)},onKeyDown:G=>{if(G.key==="Enter"||G.key===" "){if(G.preventDefault(),p)return;k(G.currentTarget)}},children:e.eventName}),a.jsx(qo,{value:e.eventName,label:"event name"}),!p&&$]})]})},"event");case"summary":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 text-spur-text align-middle truncate",title:ht(i.summary),children:ht(i.summary)},"summary");case"correlation":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[a.jsx("span",{className:"truncate",title:ht(i.correlation),children:ht(i.correlation)}),i.correlation&&i.correlation!=="unavailable"&&a.jsx(qo,{value:i.correlation,label:"correlation"})]})},"correlation");case"outcome":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:ht(i.outcome),children:ht(i.outcome)},"outcome");case"agent":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:i.agent??"",children:i.agent??""},"agent");case"producer":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:ht(i.producer),children:ht(i.producer)},"producer");case"action":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:ht(i.actionLabel),children:ht(i.actionLabel)},"action");case"actor":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:S,children:S},"actor")}};return a.jsxs(a.Fragment,{children:[a.jsx("tr",{className:"group hover:bg-base-200/60 transition-colors",style:{height:n?void 0:28},children:n?a.jsxs(a.Fragment,{children:[a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-spur-text-muted whitespace-nowrap align-middle",children:qE(e.occurredAt)}),a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 relative align-middle min-w-0",children:a.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("button",{type:"button","aria-expanded":l,"aria-controls":`detail-${e.id}`,"aria-label":`${l?"Collapse":"Expand"} detail for ${e.eventName}`,onClick:F,onKeyDown:C,className:"inline-flex items-center justify-center w-4 h-4 text-spur-text-muted hover:text-spur-text text-[10px] transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-spur-text/40 shrink-0",children:l?"▾":"▸"}),a.jsxs("div",{className:"relative min-w-0 max-w-full flex items-center gap-1",children:[a.jsx("button",{ref:y,type:"button",className:`font-mono font-semibold truncate block max-w-full text-left cursor-pointer bg-transparent border-0 p-0 ${o}`,"data-testid":"system-event-name","aria-label":`Context for ${e.eventName}. Hover to preview; click to pin for select and copy.`,"aria-describedby":A?`system-event-tooltip-${e.id}`:void 0,onMouseEnter:()=>{N(),d(!0)},onFocus:()=>{N(),d(!0)},onBlur:M=>{!p&&!x.current?.contains(M.relatedTarget)&&d(!1)},onMouseLeave:()=>{N(),v.current=setTimeout(()=>{p||d(!1)},200)},onClick:M=>{M.preventDefault(),M.stopPropagation(),!p&&k(M.currentTarget,M.clientX,M.clientY)},onKeyDown:M=>{if(M.key==="Enter"||M.key===" "){if(M.preventDefault(),p)return;k(M.currentTarget)}},children:e.eventName}),a.jsx(qo,{value:e.eventName,label:"event name"}),!p&&$]})]}),a.jsxs("div",{className:"flex flex-col gap-0.5 text-[10px] text-spur-text-muted min-w-0",children:[a.jsx(Yc,{severity:i.severity}),a.jsx("span",{className:"truncate text-spur-text",title:ht(i.summary),children:ht(i.summary)}),a.jsx("span",{className:"truncate",title:ht(i.producer),children:ht(i.producer)}),a.jsx("span",{className:"truncate",title:ht(i.correlation),children:ht(i.correlation)}),i.agent&&a.jsxs("span",{className:"truncate font-mono",title:i.agent,children:["agent: ",i.agent]}),a.jsxs("span",{className:"truncate",children:["outcome: ",ht(i.outcome)]}),a.jsxs("span",{className:"truncate",title:ht(i.actionLabel),children:["action: ",ht(i.actionLabel)]})]})]})})]}):r.map(M=>z(M))}),l&&a.jsx("tr",{children:a.jsx("td",{colSpan:n?2:r.length,className:"px-3 py-2 border-b border-spur-border/40 bg-base-300/40",children:a.jsxs("section",{id:`detail-${e.id}`,"aria-label":`Detail for ${e.eventName}`,onKeyDown:C,tabIndex:-1,className:"flex flex-col gap-2 text-[11px] text-spur-text max-w-full",children:[a.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 font-mono text-[10px]",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"project:"})," ",ht(i.projectName)]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"root:"})," ",ht(i.projectRoot)]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"producer:"})," ",ht(i.producer)]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"correlation:"})," ",ht(i.correlation)]}),e.runId&&a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx("span",{className:"text-spur-text-muted",children:"runId:"})," ",e.runId," ",a.jsx(qo,{value:e.runId,label:"run ID"})]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"agent:"})," ",i.agent||"-"]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"actor:"})," ",S]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"prefix:"})," ",s]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"tier:"})," ",t]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"outcome:"})," ",ht(i.outcome)]})]}),i.fields.length>0&&a.jsx("dl",{className:"space-y-0.5",children:i.fields.map(M=>a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("dt",{className:"text-spur-text-muted shrink-0",children:[M.label,":"]}),a.jsx("dd",{className:"font-mono break-all",children:ht(M.value)})]},M.label+M.value))}),a.jsxs("div",{className:"border-t border-spur-border/40 pt-1",children:[a.jsx("div",{className:"text-spur-text-muted text-[10px] mb-0.5",children:"payload (redacted):"}),a.jsx("pre",{className:"font-mono text-[10px] text-spur-text-muted overflow-x-auto whitespace-pre-wrap break-all",children:e.envelope?JSON.stringify(e.envelope,null,2):"-"})]}),a.jsx("button",{type:"button",onClick:()=>u(!1),className:"self-start text-[10px] text-spur-text-muted hover:text-error px-2 py-0.5 rounded border border-spur-border/40 hover:border-error/40 transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-spur-text/40",children:"Close (Esc)"})]})})}),p&&$&&typeof document<"u"?Or.createPortal($,document.body):null]})}function DW(e){if(!e.payload)return;if(typeof e.payload.jobId=="string")return e.payload.jobId;const n=e.payload.context?.correlation;if(typeof n?.jobId=="string")return n.jobId}function OW(e){switch(e){case"completed":return"success";case"processing":return"info";case"failed":return"error";default:return"neutral"}}function LW({job:e,onClose:t,onNavigate:n}){const[r,s]=g.useState([]),[i,o]=g.useState(null),[l,u]=g.useState(!1),c=g.useRef(0);return g.useEffect(()=>{if(!e){s([]),o(null);return}const d=m=>{m.key==="Escape"&&t()};window.addEventListener("keydown",d);const p=new AbortController,f=++c.current;return u(!0),(async()=>{try{const m=Xd({prefix:"queue",since:e.queuedAt,limit:200}),b=await Ge(new Request(m,{signal:p.signal}));if(!b.ok)throw new Error(`HTTP ${b.status}`);const x=Qd(await b.json());if(p.signal.aborted||f!==c.current)return;const y=(x?.events??[]).filter(v=>DW(v)===e.id);o(y.length);const E=y.map(v=>{const S=v.payload;return{id:v.id,eventName:v.eventName,occurredAt:v.occurredAt,error:typeof S?.error=="string"?S.error:void 0,attempt:typeof S?.attempt=="number"?S.attempt:void 0}});e.startedAt&&E.push({id:`synth-started-${e.id}`,eventName:"queue.job.started",occurredAt:e.startedAt,derived:!0}),E.sort((v,S)=>new Date(v.occurredAt).getTime()-new Date(S.occurredAt).getTime()),s(E)}catch{if(p.signal.aborted||f!==c.current)return;o(0);const m=[];e.startedAt&&m.push({id:`synth-started-${e.id}`,eventName:"queue.job.started",occurredAt:e.startedAt,derived:!0}),s(m)}finally{!p.signal.aborted&&f===c.current&&u(!1)}})(),()=>{window.removeEventListener("keydown",d),p.abort()}},[e,t]),e?a.jsx("div",{className:"fixed inset-0 z-50 flex justify-end bg-black/60 backdrop-blur-xs",onClick:t,onKeyDown:d=>{d.key==="Escape"&&t()},role:"dialog","aria-modal":"true","aria-label":`Job details for ${e.id}`,"data-testid":"job-detail-drawer",children:a.jsxs("div",{className:"w-full max-w-xl h-full bg-base-100 border-l border-base-content/10 shadow-2xl flex flex-col overflow-hidden",onClick:d=>d.stopPropagation(),onKeyDown:d=>d.stopPropagation(),role:"document",children:[a.jsxs("div",{className:"px-5 py-4 border-b border-base-content/10 flex items-center justify-between bg-base-200/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Lt,{variant:OW(e.status),size:"sm",children:e.status}),a.jsx("span",{className:"font-mono text-sm font-semibold text-base-content truncate max-w-xs",children:e.id})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[n&&a.jsx(Fe,{variant:"outline",size:"xs","data-testid":"navigate-system-events-btn",onClick:()=>n({tab:"system-events",runId:e.id}),children:"View in System Events"}),a.jsx(Fe,{variant:"ghost",size:"xs",onClick:t,"aria-label":"Close drawer","data-testid":"close-job-drawer",children:"✕"})]})]}),a.jsxs("div",{className:"p-5 flex-1 overflow-y-auto space-y-5",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3 bg-base-200/40 p-3 rounded-lg border border-base-content/10 text-xs font-mono",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Type"}),a.jsx("span",{className:"font-semibold text-base-content",children:e.type})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Attempts"}),a.jsxs("span",{className:"text-base-content",children:[e.attempts," / ",e.maxRetries]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Queued At"}),a.jsx("span",{className:"text-base-content",children:new Date(e.queuedAt).toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Started At"}),a.jsx("span",{className:"text-base-content",children:e.startedAt?new Date(e.startedAt).toLocaleString():"—"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Ended At"}),a.jsx("span",{className:"text-base-content",children:e.endedAt?new Date(e.endedAt).toLocaleString():"—"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Duration"}),a.jsx("span",{className:"text-base-content",children:e.durationMs!==null?Dv(e.durationMs):"—"})]})]}),e.lastError&&a.jsxs("div",{className:"p-3 rounded-lg bg-error/10 border border-error/20 text-error text-xs font-mono whitespace-pre-wrap break-words",children:[a.jsx("span",{className:"font-bold block mb-1",children:"Last Error:"}),e.lastError]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Payload"}),a.jsx("div",{className:"bg-base-200 p-3 rounded-lg border border-base-content/10 font-mono text-xs overflow-x-auto max-h-48 text-base-content/90",children:e.payload?a.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(e.payload,null,2)}):a.jsx("span",{className:"text-base-content/50 italic",children:"payload unavailable"})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Lifecycle Timeline"}),l&&a.jsx("span",{className:"text-[10px] text-base-content/50",children:"Loading…"})]}),i===0&&!l&&a.jsxs("div",{className:"p-4 rounded-lg border border-base-content/10 bg-base-200/40 text-xs text-base-content/60 italic","data-testid":"empty-lifecycle-timeline",children:["No lifecycle events recorded. Queue lifecycle events are diagnostic-tier — set"," ",a.jsx("code",{className:"font-mono text-base-content",children:"SPUR_DIAGNOSTIC_EVENTS=1"})," to capture them."]}),r.length>0&&a.jsx("div",{className:"space-y-2 font-mono text-xs","data-testid":"lifecycle-timeline-list",children:r.map(d=>a.jsxs("div",{className:"p-2.5 rounded-lg border border-base-content/10 bg-base-200/60 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"font-semibold text-base-content",children:d.eventName}),d.derived&&a.jsx(Lt,{size:"xs",variant:"outline",children:"derived"}),d.attempt!==void 0&&a.jsxs(Lt,{size:"xs",variant:"neutral",children:["attempt ",d.attempt]}),d.error&&a.jsx("span",{className:"text-error truncate max-w-xs",children:d.error})]}),a.jsx("span",{className:"text-[11px] text-base-content/50 shrink-0",children:new Date(d.occurredAt).toLocaleTimeString()})]},d.id))})]})]})]})}):null}function jW(e){switch(e){case"failed":return"failed";case"running":return"processing";case"completed":return"completed";default:return}}function MW(e){switch(e){case"completed":return"success";case"processing":return"info";case"failed":return"error";default:return"neutral"}}const FW=()=>{const[e,t]=g.useState(null),[n,r]=g.useState(null),[s,i]=g.useState(!0);return g.useEffect(()=>{const o=new AbortController;return(async()=>{try{const l=await Ge(new Request(`${nt()}/jobs/schedules`,{signal:o.signal}));if(!l.ok)throw new Error(`HTTP ${l.status}`);const u=await l.json();if(o.signal.aborted)return;t(u.schedules)}catch(l){if(o.signal.aborted)return;r(l instanceof Error?l.message:String(l))}finally{o.signal.aborted||i(!1)}})(),()=>o.abort()},[]),a.jsxs("div",{className:"p-4 rounded-xl border border-base-content/10 bg-base-200/80 shadow-xs space-y-3","data-testid":"active-schedules-card",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/70",children:"Active Schedules"}),e&&a.jsx(Lt,{size:"xs",variant:"outline",children:e.length})]}),a.jsx("span",{className:"text-[11px] text-base-content/50",children:"Recurring background cron jobs"})]}),s?a.jsx("div",{className:"text-xs text-base-content/50 py-2",children:"Loading schedules…"}):n?a.jsxs("div",{className:"text-xs text-error/80 py-1","data-testid":"schedules-error",children:["Schedules unavailable: ",n]}):!e||e.length===0?a.jsx("div",{className:"text-xs text-base-content/50 py-2 italic",children:"No active schedules registered."}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2.5 font-mono text-xs",children:e.map(o=>a.jsxs("div",{className:"p-2.5 rounded-lg border border-base-content/10 bg-base-100 flex flex-col gap-1.5","data-testid":`schedule-item-${o.name}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-1",children:[a.jsx("span",{className:"font-semibold text-base-content truncate",children:o.name}),a.jsx(Lt,{size:"xs",variant:o.source==="builtin"?"neutral":"info",children:o.source})]}),a.jsxs("div",{className:"flex items-center justify-between text-[11px] text-base-content/60",children:[a.jsx("span",{children:o.cadence}),a.jsx("span",{className:"text-base-content/40",children:o.cron})]}),a.jsxs("div",{className:"flex items-center justify-between text-[10px] text-base-content/50 border-t border-base-content/5 pt-1 mt-0.5",children:[a.jsx("span",{children:o.nextFireAt===null?"next run: cron (unknown)":`next: ${new Date(o.nextFireAt).toLocaleTimeString()}`}),a.jsx("span",{children:o.lastStatus==="none"?"never run":o.lastStatus})]})]},o.name))})]})};function PW({timeRange:e,onNavigate:t}){const[n,r]=g.useState("all"),[s,i]=g.useState([]),[o,l]=g.useState({all:0,pending:0,processing:0,completed:0,failed:0}),[u,c]=g.useState(!1),[d,p]=g.useState(0),[f,m]=g.useState(!0),[b,x]=g.useState(null),[y,E]=g.useState(new Set),[v,S]=g.useState(null),A=g.useRef(0),N=g.useRef({timeRange:e,statusFilter:n});g.useEffect(()=>{const k=new AbortController,F=++A.current;return m(!0),x(null),(async()=>{try{const C=N.current.timeRange!==e||N.current.statusFilter!==n;C&&(N.current={timeRange:e,statusFilter:n});const $=C?0:d;C&&d!==0&&p(0);const z=Uu(e),M=new URLSearchParams,G=jW(n);G&&M.set("status",G),z&&M.set("since",z),M.set("limit","100"),M.set("offset",String($));const H=await Ge(new Request(`${nt()}/jobs?${M.toString()}`,{signal:k.signal}));if(!H.ok){const q=await H.text();throw new Error(`HTTP ${H.status}: ${q||H.statusText}`)}const j=await H.json();if(k.signal.aborted||F!==A.current)return;i($===0?j.jobs:q=>[...q,...j.jobs]),l(j.countsByStatus),c(j.hasMore),m(!1)}catch(C){if(k.signal.aborted||F!==A.current)return;x(C instanceof Error?C.message:String(C)),m(!1)}})(),()=>k.abort()},[e,n,d]);const T=(k,F)=>{F.stopPropagation(),E(C=>{const $=new Set(C);return $.has(k)?$.delete(k):$.add(k),$})},w=[{id:"all",label:"All",count:o.all},{id:"failed",label:"Failed",count:o.failed},{id:"running",label:"Running",count:o.processing},{id:"completed",label:"Completed",count:o.completed}];return a.jsxs("div",{className:"flex flex-col gap-4","data-jobs-tab":!0,"data-testid":"observability-jobs-tab",children:[a.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[a.jsx("div",{className:"flex items-center gap-1.5","data-testid":"job-status-chips",children:w.map(k=>{const F=n===k.id;return a.jsxs("button",{type:"button",onClick:()=>r(k.id),"data-testid":`status-chip-${k.id}`,className:`inline-flex items-center gap-1.5 px-3 py-1 text-xs font-semibold rounded-full transition-colors cursor-pointer ${F?k.id==="failed"?"bg-error text-error-content":"bg-neutral text-neutral-content":"bg-base-100 text-base-content/70 hover:bg-base-200 border border-base-content/10"}`,children:[a.jsx("span",{children:k.label}),a.jsx("span",{className:`px-1.5 py-0.2 text-[10px] rounded-full ${F?"bg-base-100/20":"bg-base-200 text-base-content/70"}`,children:k.count.toLocaleString()})]},k.id)})}),a.jsx(_v,{})]}),o.failed>0&&a.jsxs("div",{className:"p-3 rounded-xl bg-error/10 border border-error/20 flex items-center justify-between text-xs text-error font-medium","data-testid":"jobs-failure-banner",children:[a.jsxs("span",{children:["⚠️ ",o.failed," ",o.failed===1?"job":"jobs"," failed in this window"]}),a.jsx("button",{type:"button",className:"px-2.5 py-1 text-xs font-semibold rounded-lg border border-error text-error hover:bg-error hover:text-error-content transition-colors cursor-pointer","data-testid":"filter-to-failed-btn",onClick:()=>r("failed"),children:"Filter to Failed"})]}),a.jsx(FW,{}),a.jsxs("div",{className:"rounded-xl border border-base-content/10 bg-base-200/50 shadow-xs overflow-hidden flex flex-col",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-base-content/10 bg-base-200 flex items-center justify-between flex-wrap gap-2",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/70",children:"Queue Jobs"}),a.jsxs("span",{className:"text-xs text-base-content/50 font-mono",children:["Showing ",s.length," of ",o.all," job(s)"]})]}),b?a.jsxs("div",{className:"p-4 text-xs text-error",role:"alert","data-testid":"jobs-table-error",children:["Failed to load jobs: ",b]}):f&&s.length===0?a.jsxs("div",{className:"flex items-center justify-center h-32 text-base-content/50 text-sm",children:[a.jsx(Ss,{size:"sm"})," Loading jobs…"]}):s.length===0?a.jsx("div",{className:"p-8 text-center text-xs text-base-content/50 italic","data-testid":"jobs-empty-state",children:"No jobs found in this time range."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-xs w-full font-mono text-xs","data-testid":"queue-jobs-table",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Job Type"}),a.jsx("th",{children:"Enqueued At"}),a.jsx("th",{children:"Started At"}),a.jsx("th",{children:"Duration"}),a.jsx("th",{children:"Attempts"}),a.jsx("th",{children:"Error"})]})}),a.jsx("tbody",{children:s.map(k=>{const F=y.has(k.id);return a.jsxs("tr",{className:"hover:bg-base-300/40 cursor-pointer transition-colors",onClick:()=>S(k),"data-testid":`job-row-${k.id}`,children:[a.jsx("td",{children:a.jsx(Lt,{size:"xs",variant:MW(k.status),children:k.status})}),a.jsx("td",{className:"font-semibold text-base-content",children:k.type}),a.jsx("td",{className:"text-base-content/60",children:new Date(k.queuedAt).toLocaleTimeString()}),a.jsx("td",{className:"text-base-content/60",children:k.startedAt?new Date(k.startedAt).toLocaleTimeString():"—"}),a.jsx("td",{className:"text-base-content/80",children:k.durationMs!==null?Dv(k.durationMs):"—"}),a.jsxs("td",{className:"text-base-content/60",children:[k.attempts," / ",k.maxRetries]}),a.jsx("td",{className:"max-w-xs",children:k.lastError?a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("div",{className:`text-error ${F?"whitespace-pre-wrap":"truncate"}`,"data-testid":`job-error-${k.id}`,children:k.lastError}),a.jsx("button",{type:"button",className:"text-[10px] text-base-content/60 hover:text-base-content underline self-start","data-testid":`expand-error-btn-${k.id}`,onClick:C=>T(k.id,C),children:F?"Hide":"Details"})]}):null})]},k.id)})})]})}),u&&a.jsx("div",{className:"p-3 border-t border-base-content/10 flex justify-center bg-base-200/30",children:a.jsx(Fe,{variant:"ghost",size:"xs",disabled:f,onClick:()=>p(k=>k+100),"data-testid":"jobs-load-more-btn",children:f?"Loading…":"Load more"})})]}),a.jsx(LW,{job:v,onClose:()=>S(null),onNavigate:t})]})}function YE(e){if(e===null||typeof e!="object")return null;const t=e;return typeof t.inputTokens!="number"||typeof t.outputTokens!="number"||typeof t.cacheReadTokens!="number"||typeof t.cacheCreationTokens!="number"||typeof t.records!="number"||typeof t.recordsWithUsage!="number"?null:{inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheReadTokens:t.cacheReadTokens,cacheCreationTokens:t.cacheCreationTokens,records:t.records,recordsWithUsage:t.recordsWithUsage}}function BW(e){if(e===null||typeof e!="object")return null;const t=e;return!(t.role===null||typeof t.role=="string")||typeof t.totalRuns!="number"||typeof t.matchedRuns!="number"||typeof t.unmeasured!="boolean"?null:{role:t.role,totalRuns:t.totalRuns,matchedRuns:t.matchedRuns,exact:YE(t.exact),estimated:YE(t.estimated),unmeasured:t.unmeasured}}function UW(e){if(e===null||typeof e!="object")return null;const t=e;return!(t.role===null||typeof t.role=="string")||typeof t.executor!="string"||!(t.source===null||typeof t.source=="string")||typeof t.runs!="number"||typeof t.escalations!="number"?null:{role:t.role,executor:t.executor,source:t.source,runs:t.runs,escalations:t.escalations}}function $W(e){if(e===null||typeof e!="object")return null;const t=e,n=t.routing,r=t.tokens;if(n===null||typeof n!="object"||r===null||typeof r!="object")return null;const s=n,i=r,o=s.window;if(o===null||typeof o!="object")return null;const l=o;if(typeof l.since!="string"||typeof l.until!="string"||!Array.isArray(s.pairs)||!Array.isArray(i.roles))return null;const u=[];for(const d of s.pairs){const p=UW(d);p&&u.push(p)}const c=[];for(const d of i.roles){const p=BW(d);p&&c.push(p)}return{window:{since:l.since,until:l.until},pairs:u,roles:c}}function zW(e){switch(e){case"explicit":return"pinned";case"role":return"resolved";case"default":return"default";case null:return"—";default:return e}}const HW=new Intl.NumberFormat("en-US");function Ws(e){return HW.format(e)}function KE({label:e,totals:t}){return a.jsxs("div",{"data-token-bucket":e,className:"text-xs",children:[a.jsx(Lt,{size:"xs",variant:e==="estimated"?"warning":"success",children:e}),a.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5 mt-1",children:[a.jsx("dt",{className:"text-spur-text-muted",children:"input"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.inputTokens)}),a.jsx("dt",{className:"text-spur-text-muted",children:"cache read"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.cacheReadTokens)}),a.jsx("dt",{className:"text-spur-text-muted",children:"cache write"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.cacheCreationTokens)}),a.jsx("dt",{className:"text-spur-text-muted",children:"output"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.outputTokens)})]})]})}function GW({role:e}){const t=e.role??"—";return a.jsxs("div",{className:"bg-base-100 border border-spur-border rounded-md p-3","data-role-attribution":t,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-sm font-semibold text-spur-text",children:t}),a.jsxs("span",{className:"text-[10px] text-spur-text-muted tabular-nums",children:["matched ",e.matchedRuns," of ",e.totalRuns," runs"]})]}),e.unmeasured?a.jsxs("div",{className:"mt-1 text-xs","data-unmeasured":!0,children:[a.jsx(Lt,{size:"xs",variant:"ghost",children:"unmeasured"}),a.jsx("span",{className:"ml-1 text-spur-text-muted",children:"no token data recorded for this role — not a measured zero"})]}):a.jsxs("div",{className:"mt-2 flex flex-wrap gap-4",children:[e.exact?a.jsx(KE,{label:"exact",totals:e.exact}):null,e.estimated?a.jsx(KE,{label:"estimated",totals:e.estimated}):null]})]})}function WW({timeRange:e}){const[t,n]=g.useState(null),[r,s]=g.useState(null);if(g.useEffect(()=>{const o=new AbortController,l=Uu(e),u=nt(),c=l?`${u}/observability/routing-summary?since=${encodeURIComponent(l)}`:`${u}/observability/routing-summary`;return(async()=>{try{const d=await Ge(new Request(c,{signal:o.signal}));if(!d.ok)throw new Error(`routing summary fetch failed: ${d.status}`);const p=$W(await d.json());if(!p)throw new Error("routing summary response failed schema validation");n(p)}catch(d){if(o.signal.aborted)return;s(d instanceof Error?d.message:String(d))}})(),()=>o.abort()},[e]),r)return a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load routing summary: ",r]});if(t===null)return a.jsxs("div",{className:"flex items-center justify-center h-32 text-spur-text-muted text-sm",children:[a.jsx(Ss,{size:"sm"})," Loading routing summary…"]});const i=t.pairs.length===0&&t.roles.length===0;return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden","data-routing-tab":!0,children:[a.jsxs("div",{className:"px-4 py-2 border-b border-spur-border bg-base-200 shrink-0 flex items-baseline justify-between",children:[a.jsx("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:"Routing & token consumption"}),a.jsxs("span",{className:"text-[10px] text-spur-text-muted tabular-nums","data-covered-window":!0,children:["covered ",t.window.since," → ",t.window.until]})]}),i?a.jsx("div",{className:"flex-1 flex items-center justify-center p-4","data-routing-empty":!0,children:a.jsx("div",{className:"text-sm text-spur-text-muted italic",children:"No routing attribution has been recorded in the covered window — nothing to show yet."})}):a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[t.pairs.length>0?a.jsxs("section",{className:"bg-base-100 border border-spur-border rounded-md","data-routing-table":!0,children:[a.jsxs("div",{className:"px-3 py-2 border-b border-spur-border",children:[a.jsx("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:"Role → executor"}),a.jsx("span",{className:"ml-2 text-[10px] text-spur-text-muted",children:"runs and escalations per pair; pinned and role-resolved counted separately"})]}),a.jsxs("table",{className:"table table-sm w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-[10px] uppercase text-spur-text-muted",children:[a.jsx("th",{children:"Role"}),a.jsx("th",{children:"Executor"}),a.jsx("th",{children:"Source"}),a.jsx("th",{className:"text-right",children:"Runs"}),a.jsx("th",{className:"text-right",children:"Escalations"})]})}),a.jsx("tbody",{children:t.pairs.map(o=>a.jsxs("tr",{children:[a.jsx("td",{className:"text-sm text-spur-text",children:o.role??"—"}),a.jsx("td",{className:"text-sm text-spur-text",children:o.executor}),a.jsx("td",{children:a.jsx(Lt,{size:"xs",variant:o.source==="explicit"?"warning":"ghost",children:zW(o.source)})}),a.jsx("td",{className:"text-right tabular-nums text-spur-text",children:Ws(o.runs)}),a.jsx("td",{className:"text-right tabular-nums text-spur-text",children:Ws(o.escalations)})]},`${o.role??""}:${o.executor}:${o.source??""}`))})]}),a.jsx("div",{className:"px-3 py-1.5 border-t border-spur-border text-[10px] text-spur-text-muted",children:"“—” role groups pure pins (no role recorded); escalations count runs that started too cheap on this executor."})]}):null,t.roles.length>0?a.jsxs("section",{"data-token-section":!0,children:[a.jsxs("div",{className:"px-1 pb-1.5",children:[a.jsx("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:"Token consumption by role"}),a.jsx("span",{className:"ml-2 text-[10px] text-spur-text-muted",children:"input, cache read, cache write, output — token totals only"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:t.roles.map(o=>a.jsx(GW,{role:o},o.role??"pin"))})]}):null]})]})}const qW={system:"#38bdf8",task:"#818cf8",feature:"#a78bfa",queue:"#f59e0b",scheduler:"#10b981",rule:"#ec4899",agent:"#06b6d4",history:"#64748b"},ZE=["#38bdf8","#818cf8","#a78bfa","#f59e0b","#10b981","#ec4899","#06b6d4","#f43f5e","#64748b"];function Kc(e){const t=qW[e];if(t)return t;let n=0;for(let s=0;s<e.length;s++)n=(n<<5)-n+e.charCodeAt(s),n|=0;const r=Math.abs(n)%ZE.length;return ZE[r]??"#38bdf8"}function VW(e){return e==null||!Number.isFinite(e)?"—":(e/1e3).toFixed(2)}const YW=(e,t)=>t===void 0||t===0?null:(e-t)/Math.abs(t)*100,KW=g.memo(({current:e,previous:t,invert:n=!1})=>{if(t===void 0)return a.jsx("span",{className:"text-[10px] text-base-content/40",children:"No prior baseline"});if(t===0)return a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold font-mono bg-info/15 text-info",children:"new"});const r=YW(e,t);if(r===null)return a.jsx("span",{className:"text-[10px] text-base-content/40",children:"No prior baseline"});const s=r>=0,i=n?!s:s;return a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold font-mono ${i?"bg-emerald-500/15 text-emerald-400":"bg-error/15 text-error"}`,children:[s?"↑ +":"↓ ",Math.abs(r).toFixed(1),"% vs previous period"]})}),Vo=g.memo(({label:e,value:t,sub:n,trend:r,trendColor:s="#38bdf8",current:i,previous:o,invert:l,testId:u})=>a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-4","data-testid":u,children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:e})}),a.jsxs("div",{className:"flex items-end justify-between gap-2 mt-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold font-mono text-primary",children:t}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[a.jsx(KW,{current:i,previous:o,invert:l}),a.jsx("span",{className:"text-xs text-base-content/60",children:n})]})]}),r&&r.length>1?a.jsx(gv,{values:r,color:s,width:100,height:34}):null]})]}));function ZW(e){const t=g.useRef(0),[n,r]=g.useState(null),[s,i]=g.useState(null),[o,l]=g.useState(!0),[u,c]=g.useState(null),d=e.timeRange??"4h";g.useEffect(()=>{const N=++t.current,T=new AbortController;l(!0),c(null);async function w(){try{const k=Date.now(),F=Uu(d,k),C=new Date(k).toISOString();let $=`${nt()}/observability/summary`;if(F){const re=new URLSearchParams({since:F,until:C});$+=`?${re.toString()}`}const z=Ge(new Request($,{signal:T.signal}),1e4);let M=Promise.resolve(null);if(F){const re=new Date(F).getTime(),pe=k-re,I=new Date(re-pe).toISOString(),Z=F,ie=new URLSearchParams({since:I,until:Z,period:"previous"}),L=`${nt()}/observability/summary?${ie.toString()}`;M=Ge(new Request(L,{signal:T.signal}),1e4).catch(()=>null)}const[G,H]=await Promise.all([z,M]);if(N!==t.current)return;if(!G.ok){const re=await G.text();throw new Error(`HTTP ${G.status}: ${re||G.statusText}`)}const j=await G.json();let q=null;if(H?.ok)try{q=await H.json()}catch{}if(N!==t.current)return;r(j),i(q),l(!1)}catch(k){if(T.signal.aborted||N!==t.current)return;c(k instanceof Error?k.message:String(k)),l(!1)}}return w(),()=>{T.abort()}},[d]);const{series:p,chartBuckets:f}=g.useMemo(()=>{const N=n?.eventVolumeBuckets??[],T={};for(const C of N)for(const[$,z]of Object.entries(C.byPrefix))T[$]=(T[$]??0)+z;const k=Object.keys(T).sort((C,$)=>(T[$]??0)-(T[C]??0)).map(C=>({id:C,label:C,color:Kc(C)})),F=N.map(C=>({id:C.timestamp,label:Rl(C.timestamp),v:C.byPrefix}));return{series:k,chartBuckets:F}},[n?.eventVolumeBuckets]),m=g.useMemo(()=>{const N={info:0,warning:0,error:0,unknown:0};for(const w of n?.eventVolumeBuckets??[])N.info+=w.bySeverity.info,N.warning+=w.bySeverity.warning,N.error+=w.bySeverity.error,N.unknown+=w.bySeverity.unknown;const T=N.info+N.warning+N.error+N.unknown;return{counts:N,sum:T}},[n?.eventVolumeBuckets]);if(o)return a.jsxs("div",{className:"flex flex-col gap-6 animate-pulse","data-testid":"observability-summary-tab","data-summary-tab":!0,children:[a.jsx("div",{"data-testid":"observability-summary-skeleton",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[1,2,3,4].map(N=>a.jsx("div",{className:"h-24 bg-base-200/60 rounded-xl"},N))}),a.jsx("div",{className:"h-64 bg-base-200/60 rounded-xl"})]});if(u)return a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error","data-testid":"observability-summary-error","data-summary-tab":!0,children:a.jsxs("span",{children:["Failed to load observability summary: ",u]})});const b=n?.kpis??{totalEvents:0,activeJobs:0,completedJobs:0,failedJobs:0,successRatePct:0,errorEventCount:0,warningEventCount:0},x=s?.kpis,y=n?.eventVolumeBuckets??[],E=y.map(N=>N.total),v=y.map(N=>N.bySeverity.error+N.bySeverity.warning),S=N=>{e.onNavigate?.({tab:"jobs",jobId:N})},A=(N,T)=>{e.onNavigate?.({tab:"system-events",eventName:N,runId:T})};return a.jsxs("div",{className:"flex flex-col gap-6","data-testid":"observability-summary-tab","data-summary-tab":!0,children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx(Vo,{label:"Total Events",value:Ct(b.totalEvents),sub:"events in window",trend:E,trendColor:"#38bdf8",current:b.totalEvents,previous:x?.totalEvents,testId:"kpi-card-total-events"}),a.jsx(Vo,{label:"Active In-Flight Jobs",value:Ct(b.activeJobs),sub:"pending & processing",current:b.activeJobs,previous:x?.activeJobs,testId:"kpi-card-active-jobs"}),a.jsx(Vo,{label:"Success Rate",value:`${b.successRatePct}%`,sub:`${b.completedJobs} ok / ${b.failedJobs} fail`,current:b.successRatePct,previous:x?.successRatePct,testId:"kpi-card-success-rate"}),a.jsx(Vo,{label:"Errors & Warnings",value:`${b.errorEventCount} / ${b.warningEventCount}`,sub:"error / warning events",trend:v,trendColor:"#ef4444",current:b.errorEventCount+b.warningEventCount,previous:x?x.errorEventCount+x.warningEventCount:void 0,invert:!0,testId:"kpi-card-errors-warnings"})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-3",children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Event Volume Over Time"}),a.jsx("p",{className:"text-xs text-base-content/60 mt-0.5",children:"Distribution stacked by event prefix"})]})}),f.length>0&&p.length>0?a.jsx("div",{className:"mt-2","data-testid":"stacked-event-volume-chart",children:a.jsx(hv,{buckets:f,series:p,height:240})}):a.jsx("div",{className:"p-8 text-center text-xs text-base-content/50","data-testid":"empty-chart-fallback",children:"No event activity recorded in this time range."})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-2",children:[a.jsxs("div",{className:"flex justify-between items-center text-xs font-semibold uppercase tracking-wider text-base-content/60",children:[a.jsx("span",{children:"Severity Distribution"}),a.jsxs("span",{children:[m.sum.toLocaleString()," classified events"]})]}),a.jsx("div",{className:"w-full h-3 rounded-full bg-base-300 overflow-hidden flex","data-testid":"severity-distribution-bar",children:m.sum>0?a.jsxs(a.Fragment,{children:[m.counts.info>0&&a.jsx("div",{style:{width:`${m.counts.info/m.sum*100}%`},className:"bg-info h-full",title:`Info: ${m.counts.info}`,"data-testid":"severity-bar-info"}),m.counts.warning>0&&a.jsx("div",{style:{width:`${m.counts.warning/m.sum*100}%`},className:"bg-warning h-full",title:`Warning: ${m.counts.warning}`,"data-testid":"severity-bar-warning"}),m.counts.error>0&&a.jsx("div",{style:{width:`${m.counts.error/m.sum*100}%`},className:"bg-error h-full",title:`Error: ${m.counts.error}`,"data-testid":"severity-bar-error"}),m.counts.unknown>0&&a.jsx("div",{style:{width:`${m.counts.unknown/m.sum*100}%`},className:"bg-base-content/20 h-full",title:`Unknown: ${m.counts.unknown}`,"data-testid":"severity-bar-unknown"})]}):a.jsx("div",{className:"w-full h-full bg-base-content/10"})}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-xs text-base-content/70 mt-1",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-info inline-block"})," Info:"," ",m.counts.info.toLocaleString()]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-warning inline-block"})," Warning:"," ",m.counts.warning.toLocaleString()]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-error inline-block"})," Error:"," ",m.counts.error.toLocaleString()]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-base-content/20 inline-block"})," Unknown:"," ",m.counts.unknown.toLocaleString()]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-3",children:[a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Top Event Types"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-xs w-full font-mono text-xs","data-testid":"top-event-types-table",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{children:"Event Name"}),a.jsx("th",{children:"Prefix"}),a.jsx("th",{className:"text-right",children:"Count"}),a.jsx("th",{className:"text-right",title:"Average duration in seconds",children:"Avg(Duration - s)"}),a.jsx("th",{className:"text-right",title:"Events with error severity",children:"Failures"}),a.jsx("th",{className:"text-right",children:"Latest"})]})}),a.jsxs("tbody",{children:[(n?.topEventTypes??[]).map(N=>a.jsxs("tr",{className:"hover:bg-base-300/40",children:[a.jsx("td",{className:"font-semibold text-base-content",children:N.name}),a.jsx("td",{children:a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold border",style:{color:Kc(N.prefix),borderColor:Kc(N.prefix)},children:N.prefix})}),a.jsx("td",{className:"text-right text-base-content/80 tabular-nums",children:N.count.toLocaleString()}),a.jsx("td",{className:"text-right text-base-content/80 tabular-nums","data-testid":`top-event-avg-${N.name}`,children:VW(N.avgDurationMs)}),a.jsx("td",{className:`text-right tabular-nums ${N.failureCount>0?"text-error font-semibold":"text-base-content/80"}`,"data-testid":`top-event-failures-${N.name}`,children:N.failureCount.toLocaleString()}),a.jsx("td",{className:"text-right text-base-content/50",children:new Date(N.latestAt).toLocaleTimeString()})]},N.name)),(!n||(n.topEventTypes??[]).length===0)&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"text-center text-base-content/40 py-4",children:"No events recorded"})})]})]})})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-3",children:[a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Recent Failures"}),a.jsxs("div",{className:"flex flex-col gap-2 max-h-[320px] overflow-y-auto","data-testid":"recent-failures-feed",children:[(n?.recentErrors??[]).map(N=>{const T=!!e.onNavigate,w=()=>{N.source==="job"?S(N.id):A(N.name,N.refId)},k=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Lt,{size:"xs",variant:N.source==="job"?"warning":"error",children:N.source}),a.jsx("span",{className:"font-mono text-xs font-semibold text-base-content",children:N.name})]}),a.jsx("span",{className:"text-[11px] text-base-content/50 font-mono",children:new Date(N.occurredAt).toLocaleTimeString()})]}),a.jsx("p",{className:"text-xs text-error font-mono truncate",children:N.message})]});return T?a.jsx("button",{type:"button",className:"w-full text-left p-2.5 rounded-lg border border-base-content/10 bg-base-100 flex flex-col gap-1 transition-colors hover:bg-base-200/80 cursor-pointer",onClick:w,"data-testid":`failure-row-${N.source}-${N.id}`,children:k},`${N.source}-${N.id}-${N.occurredAt}`):a.jsx("div",{className:"p-2.5 rounded-lg border border-base-content/10 bg-base-100 flex flex-col gap-1","data-testid":`failure-row-${N.source}-${N.id}`,children:k},`${N.source}-${N.id}-${N.occurredAt}`)}),(!n||(n.recentErrors??[]).length===0)&&a.jsx("div",{className:"p-8 text-center text-xs text-base-content/50",children:"No recent failures in this time range."})]})]})]})]})}const Zc=[{id:"summary",label:"Summary",component:ZW},{id:"system-events",label:"System Events",component:_W},{id:"jobs",label:"Jobs",component:PW},{id:"routing",label:"Routing",component:WW}];function XW(){const[e,t]=g.useState(Zc[0]?.id??""),[n,r]=g.useState("4h"),[s,i]=g.useState({status:"connecting",rate:0,lastEventAt:null}),l=Zc.find(b=>b.id===e)?.component,u=g.useCallback(b=>{i(b)},[]),c=g.useCallback(b=>{t(b.tab)},[]),d=e==="system-events",p=d?s.status:"idle",f=d?s.status==="live"?`live tail · ${s.rate} evt/60s`:s.status==="connecting"?"connecting…":s.status==="paused"?"live tail paused":"stream error":"live tail idle",m=p==="live"?"bg-emerald-400 animate-pulse":p==="connecting"?"bg-amber-400":p==="errored"?"bg-error":"bg-base-content/40";return a.jsxs("div",{className:"flex flex-col gap-4 p-4 max-w-[1600px] mx-auto w-full","data-observability-shell":!0,children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-base-content/10 pb-3 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl",children:"📡"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight",children:"Observabilities"}),a.jsx("p",{className:"text-xs text-base-content/60",children:"System event streams, queue execution telemetry, and routing attribution"}),a.jsxs("p",{className:"livechip mt-1 inline-flex items-center gap-1.5 rounded-full border border-base-content/10 px-2 py-0.5 text-xs text-base-content/60 font-mono","data-testid":"observability-liveness-chip",role:"status","aria-live":"polite",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${m}`,"aria-hidden":"true"}),f,d&&s.lastEventAt&&a.jsxs(a.Fragment,{children:[" · last ",a.jsx("time",{dateTime:s.lastEventAt,children:new Date(s.lastEventAt).toLocaleTimeString()})]})]})]})]}),a.jsx(oW,{timeRange:n,onTimeRangeChange:r}),a.jsx("div",{role:"tablist","aria-label":"Observability tabs",className:"flex items-center gap-1 bg-base-300 p-1 rounded-xl",children:Zc.map(b=>{const x=b.id===e;return a.jsx("button",{type:"button",role:"tab","aria-selected":x,"aria-controls":`observability-tab-panel-${b.id}`,id:`observability-tab-${b.id}`,onClick:()=>t(b.id),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer ${x?"bg-primary text-primary-content font-bold shadow-sm":"text-base-content/70 hover:bg-base-content/10"}`,children:b.label},b.id)})})]}),a.jsx("div",{role:"tabpanel",id:`observability-tab-panel-${e}`,"aria-labelledby":`observability-tab-${e}`,className:"mt-2 flex flex-col gap-4",children:l?a.jsx(l,{onLivenessChange:u,timeRange:n,onNavigate:c}):null})]})}const QW={id:"observability",name:"Observabilities",icon:"📡",route:"observability",component:XW,sidebarLabel:"Observabilities",description:"Real-time system events, execution traces, and agent doctor telemetry",order:10},JW=Object.freeze(Object.defineProperty({__proto__:null,module:QW},Symbol.toStringTag,{value:"Module"})),Ov=()=>`${nt()}/project/plans`;async function eq(e){const t=await Ge(new Request(Ov(),{signal:e}));if(!t.ok)throw new Error(`plan files fetch failed: ${t.status}`);const n=await t.json();if(!Array.isArray(n.files))throw new Error("plan files: invalid response shape");return n.files}async function tq(e,t){const n=`${Ov()}/file?path=${encodeURIComponent(e)}`,r=await Ge(new Request(n,{signal:t}));if(!r.ok)throw new Error(`plan file fetch failed: ${r.status}`);const s=await r.json();if(!s.ok||typeof s.content!="string")throw new Error("plan file: invalid response shape");return s}function nq({files:e,selectedPath:t,onSelect:n}){const[r,s]=g.useState(""),i=g.useMemo(()=>{if(!r.trim())return e;const u=r.toLowerCase();return e.filter(c=>c.name.toLowerCase().includes(u)||c.title.toLowerCase().includes(u)||c.path.toLowerCase().includes(u))},[e,r]),o=g.useMemo(()=>i.filter(u=>u.category==="roadmap"),[i]),l=g.useMemo(()=>i.filter(u=>u.category==="plan"),[i]);return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden","data-testid":"plan-file-list",children:[a.jsx("div",{className:"p-2 border-b border-spur-border bg-base-100/50 shrink-0",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:r,onChange:u=>s(u.target.value),placeholder:"Filter plans...",className:"w-full text-xs px-2.5 py-1.5 pl-7 rounded border border-spur-border bg-base-100 text-spur-text placeholder:text-spur-text-muted/60 focus:outline-none focus:border-spur-accent","aria-label":"Filter plan documents"}),a.jsx("span",{className:"absolute left-2 top-1.5 text-xs text-spur-text-muted pointer-events-none",children:"🔍"}),r&&a.jsx("button",{type:"button",onClick:()=>s(""),className:"absolute right-2 top-1 text-xs text-spur-text-muted hover:text-spur-text p-0.5","aria-label":"Clear filter",children:"✕"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-3",children:i.length===0?a.jsx("div",{className:"p-4 text-xs text-spur-text-muted italic text-center",children:r?`No documents match "${r}"`:"No plan documents found."}):a.jsxs(a.Fragment,{children:[o.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] font-bold uppercase tracking-wider text-spur-text-muted flex items-center justify-between",children:[a.jsx("span",{children:"Core Roadmap"}),a.jsx("span",{className:"text-[10px] font-mono",children:o.length})]}),a.jsx("div",{className:"space-y-0.5 mt-1",children:o.map(u=>{const c=t===u.path;return a.jsxs("button",{type:"button",onClick:()=>n(u.path),title:u.name,className:`w-full text-left px-2.5 py-1.5 rounded-md transition-colors flex items-center gap-2 cursor-pointer ${c?"bg-spur-accent/15 text-spur-accent font-semibold shadow-xs":"hover:bg-base-300 text-spur-text hover:text-spur-text"}`,children:[a.jsx("span",{className:"text-sm shrink-0",children:"🗺️"}),a.jsx("span",{className:"flex-1 min-w-0 text-xs truncate font-medium",title:u.name,children:u.title})]},u.id)})})]}),l.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] font-bold uppercase tracking-wider text-spur-text-muted flex items-center justify-between",children:[a.jsx("span",{children:"Execution Plans"}),a.jsx("span",{className:"text-[10px] font-mono",children:l.length})]}),a.jsx("div",{className:"space-y-0.5 mt-1",children:l.map(u=>{const c=t===u.path;return a.jsxs("button",{type:"button",onClick:()=>n(u.path),title:u.name,className:`w-full text-left px-2.5 py-1.5 rounded-md transition-colors flex items-center gap-2 cursor-pointer ${c?"bg-spur-accent/15 text-spur-accent font-semibold shadow-xs":"hover:bg-base-300 text-spur-text hover:text-spur-text"}`,children:[a.jsx("span",{className:"text-xs shrink-0 text-spur-text-muted",children:"📄"}),a.jsx("span",{className:"flex-1 min-w-0 text-xs truncate",title:u.name,children:u.title})]},u.id)})})]})]})})]})}function rq(e){if(!e)return[];const t=e.split(/\r?\n/),n=[],r=new Map;let s=!1;for(const i of t){if(i.trim().startsWith("```")){s=!s;continue}if(s)continue;const l=i.match(/^(#{1,6})\s+(.+)$/);if(l?.[1]&&l[2]){const u=l[1].length,d=l[2].trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=d.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||`heading-${n.length+1}`,m=r.get(f)??0;r.set(f,m+1);const b=m===0?f:`${f}-${m}`;n.push({id:b,text:d,level:u})}}return n}function sq(){const e=new Map;return{nextId(t){const r=t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||"heading",s=e.get(r)??0;return e.set(r,s+1),s===0?r:`${r}-${s}`}}}function aq({markdown:e,scrollContainerRef:t,onClose:n}){const r=g.useMemo(()=>rq(e),[e]),[s,i]=g.useState(null);g.useEffect(()=>{const l=t?.current;if(!l||r.length===0)return;const u=()=>{const c=l.getBoundingClientRect().top;let d=null;for(const p of r){const f=document.getElementById(p.id);f&&f.getBoundingClientRect().top-c<=100&&(d=p.id)}d&&i(d)};return l.addEventListener("scroll",u,{passive:!0}),u(),()=>l.removeEventListener("scroll",u)},[r,t]);const o=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth",block:"start"})};return a.jsxs("aside",{id:"plan-toc-dock","aria-label":"Table of Contents",className:"w-64 lg:w-72 shrink-0 rounded-lg border border-spur-border bg-base-200 shadow-xs flex flex-col overflow-hidden 3xl:absolute 3xl:top-0 3xl:bottom-0 3xl:left-[calc(100%_+_12px)] 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl","data-testid":"plan-toc-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"📑"})," Table of Contents"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[r.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:r.length}),n&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent h-5 w-5 p-0 text-xs flex items-center justify-center cursor-pointer",onClick:n,"aria-label":"Close table of contents",title:"Close table of contents",children:"✕"})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-1.5 space-y-0.5",children:r.length===0?a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No headings in document."}):r.map(l=>{const u=s===l.id;let c="pl-2 text-xs font-semibold";return l.level===2?c="pl-4 text-xs font-medium":l.level===3?c="pl-6 text-xs text-spur-text-muted":l.level>=4&&(c="pl-8 text-[11px] text-spur-text-muted"),a.jsx("button",{type:"button",onClick:()=>o(l.id),title:l.text,className:`w-full text-left py-1 pr-2 rounded transition-colors truncate block cursor-pointer ${c} ${u?"bg-spur-accent/15 text-spur-accent font-semibold":"hover:bg-base-300 hover:text-spur-text text-spur-text/80"}`,children:l.text},l.id)})})]})}function iq({source:e,className:t}){const n=Qb(e),r=sq(),s=o=>{const l=`h${o}`;return({children:u,...c})=>{const p=Oi(u).trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=r.nextId(p);return a.jsx(l,{id:f,className:"scroll-mt-6 group",...c,children:u})}},i={code:Jb,h1:s(1),h2:s(2),h3:s(3),h4:s(4),h5:s(5),h6:s(6)};return a.jsx("div",{className:`plan-markdown-container ${t??""}`,"data-testid":"plan-markdown-body",children:a.jsx(ia.Markdown,{source:n,wrapperElement:{"data-color-mode":"light"},components:i})})}function oq(){const[e,t]=ap(),[n,r]=g.useState(null),[s,i]=g.useState(()=>e.get("file")),o=g.useRef({}),[l,u]=g.useState({}),[c,d]=g.useState(!0),[p,f]=g.useState(!0),[m,b]=g.useState(!1),[x,y]=g.useState(!0),[E,v]=g.useState(!1),[S,A]=g.useState(null),[N,T]=g.useState(null),[w,k]=g.useState(!1),F=g.useRef(null),C=g.useRef(null),$=g.useCallback(async I=>{try{y(!0);const Z=await eq(I);return r(Z),A(null),Z}catch(Z){return I?.aborted||A(Z instanceof Error?Z.message:String(Z)),null}finally{y(!1)}},[]),z=g.useCallback(async(I,Z)=>{if(!o.current[I])try{v(!0),T(null);const ie=await tq(I,Z);o.current[I]=ie,u(L=>({...L,[I]:ie}))}catch(ie){if(Z?.aborted)return;T(ie instanceof Error?ie.message:String(ie))}finally{v(!1)}},[]),M=e.get("file");g.useEffect(()=>{const I=new AbortController;return(async()=>{const Z=await $(I.signal);if(Z&&Z.length>0){if(M&&Z.some(L=>L.path===M))i(M);else if(!M){const L=Z[0]?.path;L&&i(L)}}})(),()=>I.abort()},[$,M]),g.useEffect(()=>{M&&M!==s&&i(M)},[M,s]),g.useEffect(()=>{if(!s)return;const I=new AbortController;return z(s,I.signal),()=>I.abort()},[s,z]);const G=I=>{i(I),f(!0),t({file:I},{replace:!0}),F.current&&(F.current.scrollTop=0)},H=()=>{s&&(navigator.clipboard.writeText(s),k(!0),setTimeout(()=>k(!1),2e3))},j=s?l[s]:null,{frontmatterRaw:q,frontmatter:re,body:pe}=g.useMemo(()=>j?.content?Kw(j.content):{frontmatterRaw:null,frontmatter:null,body:""},[j?.content]);return S?a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load plan documents: ",S]}):x&&n===null?a.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Loading plan documents…"}):a.jsxs("div",{className:"relative h-full w-full p-4 overflow-hidden","data-plans-shell":!0,children:[a.jsxs("div",{className:"flex flex-col h-full w-full max-w-full 3xl:max-w-[1200px] 4xl:max-w-[1600px] mx-auto gap-3","data-plans-workspace":!0,children:[a.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-spur-border pb-3 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:"🗺️"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight text-spur-text",children:"Plans"}),a.jsx("p",{className:"text-xs text-spur-text-muted",children:"Project roadmap, release commitments, and execution proposals"})]})]}),a.jsxs("div",{className:"flex items-center gap-1","data-plans-actions":!0,children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>d(I=>!I),"aria-label":c?"Collapse plan file list":"Expand plan file list","aria-expanded":c,"aria-controls":"plan-files-dock",title:c?"Collapse plan file list":"Expand plan file list",children:c?"◧":"▶"}),s&&j?.content&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>f(I=>!I),"aria-label":p?"Collapse table of contents":"Expand table of contents","aria-expanded":p,"aria-controls":"plan-toc-dock",title:p?"Collapse table of contents":"Expand table of contents",children:p?"📑":"📖"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>{(async()=>(await $(),s&&(u(I=>{const Z={...I};return delete Z[s],Z}),z(s))))()},"aria-label":"Refresh plan documents",title:"Refresh plan documents",children:"🔄"})]})]}),a.jsxs("div",{className:"flex-1 min-h-0 flex items-stretch gap-3 overflow-hidden 3xl:relative 3xl:block 3xl:overflow-visible",ref:C,children:[a.jsxs("div",{id:"plan-files-dock",hidden:!c,className:`${c?"flex":"hidden"} w-64 lg:w-72 shrink-0 flex-col overflow-hidden rounded-lg border border-spur-border bg-base-200 shadow-xs 3xl:absolute 3xl:right-[calc(100%_+_12px)] 3xl:top-0 3xl:bottom-0 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl`,"data-testid":"plan-files-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"🗺️"})," Plan Docs"]}),n&&n.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:n.length})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:n&&n.length>0?a.jsx(nq,{files:n,selectedPath:s,onSelect:G}):a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No plan documents found."})})]}),a.jsx("div",{className:"flex-1 min-w-0 h-full overflow-hidden rounded-lg border border-spur-border bg-base-100 relative 3xl:w-full 3xl:flex-none","data-testid":"plan-workspace",children:a.jsx("div",{className:"w-full h-full overflow-y-auto",ref:F,children:s?a.jsxs("div",{className:"flex flex-col min-h-full",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 py-3 border-b border-spur-border bg-base-100/90 backdrop-blur-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded bg-base-200 text-spur-text-muted border border-spur-border shrink-0",children:s}),j?.title&&a.jsx("h2",{className:"text-sm font-semibold text-spur-text truncate",children:j.title})]}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent flex items-center gap-1 shrink-0",onClick:()=>b(!0),"aria-label":"View document metadata",title:"View document metadata","data-testid":"metadata-toggle",children:"ℹ Metadata"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-text shrink-0",onClick:H,"aria-label":"Copy file path",title:"Copy file path",children:w?"✓ Copied":"📋 Copy Path"})]})]}),a.jsx("div",{className:"p-6 md:p-8 flex-1","data-testid":"plan-body-container",children:E&&!j?a.jsx("div",{className:"flex items-center justify-center py-20 text-spur-text-muted text-sm",children:"Loading document content…"}):N?a.jsxs("div",{className:"p-4 text-sm text-error bg-error/10 rounded-md border border-error/20",children:["Failed to load document: ",N]}):j?a.jsx(iq,{source:pe}):null})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-spur-text-muted gap-2",children:[a.jsx("span",{className:"text-3xl","aria-hidden":"true",children:"🗺️"}),a.jsx("span",{className:"text-sm font-medium",children:"Select a plan document to view"})]})})}),s&&j?.content&&p&&a.jsx(aq,{markdown:pe,scrollContainerRef:F,onClose:()=>f(!1)})]})]}),a.jsx(lw,{open:m,onClose:()=>b(!1),title:j?.title,filePath:s,frontmatterRaw:q,frontmatter:re})]})}const lq={id:"plans",name:"Plans",icon:"🗺️",route:"plans",component:oq,sidebarLabel:"Plans",description:"Project roadmap, release commitments, and execution proposals",order:24},uq=Object.freeze(Object.defineProperty({__proto__:null,module:lq},Symbol.toStringTag,{value:"Module"})),$u="board-operator",Jd="SPUR-REQUEST/1 ";function Xc(e,t){return e.kind==="task"&&t.kind==="task"?e.wbs===t.wbs:e.kind==="feature"&&t.kind==="feature"?e.id===t.id:!1}function cq(e,t){return t.length===0?e:`${Jd}${JSON.stringify({refs:t.map(dq)})}
|
|
310
|
+
`)[0]?.trim()==="---"?"markdown":"text":"text"}function Gc(e,t){if(!e)return null;switch(PG(e,t)){case"bash":return Ol(e);case"xml":return MG(e);case"json":{const r=t?bv(t):{defaultLanguage:"json"};return Ev(e,r)}case"markdown":return FG(e);default:return e}}const BG=({code:e,toolName:t="",language:n,className:r=""})=>{const s=g.useMemo(()=>bv(t),[t]),i=n??s.defaultLanguage,o=g.useMemo(()=>i==="bash"?Ol(e):i==="diff"?yv(e):Ev(e,s),[e,i,s]);return a.jsx("div",{className:`font-mono text-[11px] select-text cursor-text ${r}`,children:o})},UG=({agentId:e,model:t="—",timestamp:n,tooltipId:r,freshInputTokens:s=0,cacheReadTokens:i=0,outputTokens:o=0,sessionId:l,className:u=""})=>{const[c,d]=g.useState(!1),p=g.useMemo(()=>`agent-badge-tt-${e}-${Math.random().toString(36).slice(2,7)}`,[e]),f=r||p,m=s+i+o;return a.jsxs("div",{className:`relative inline-flex items-center z-30 ${u}`,children:[a.jsx("button",{type:"button","aria-describedby":f,"aria-label":`Coding agent ${e} icon and metadata`,className:"p-1 rounded-md bg-base-300 border border-base-content/15 hover:border-primary text-base-content/80 hover:text-primary transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary shrink-0",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onFocus:()=>d(!0),onBlur:()=>d(!1),onKeyDown:b=>{b.key==="Escape"&&d(!1)},"data-testid":`agent-badge-${f}`,children:a.jsx(or,{id:e})}),c&&a.jsxs("div",{id:f,role:"tooltip","data-testid":f,className:"absolute left-0 top-full z-50 mt-1.5 w-64 p-3 rounded-xl bg-base-300 border border-base-content/20 shadow-2xl text-[11px] font-mono leading-relaxed pointer-events-none backdrop-blur-md flex flex-col gap-2.5 select-none",children:[a.jsx("div",{className:"flex items-center justify-between border-b border-base-content/10 pb-2",children:a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"p-1 rounded bg-base-200 text-primary shrink-0",children:a.jsx(or,{id:e})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-bold text-base-content uppercase tracking-wider text-[11px]",children:e}),a.jsx("div",{className:"text-[10px] text-base-content/60 truncate",title:t??"",children:t||"—"})]})]})}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-1 text-base-content/80 text-[10.5px]",children:[a.jsx("span",{className:"text-base-content/50",children:"Timestamp:"}),a.jsx("span",{className:"truncate",children:n?LG(n):"—"}),l&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-base-content/50",children:"Session:"}),a.jsx("span",{className:"truncate font-bold text-primary",title:l,children:l.length>16?`${l.slice(0,14)}…`:l})]})]}),a.jsxs("div",{className:"pt-2 border-t border-base-content/10 flex flex-col gap-1 text-[10.5px]",children:[a.jsx("div",{className:"font-bold text-base-content/70 text-[10px] uppercase tracking-wider",children:"Token Breakdown"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80",children:[a.jsx("span",{className:"text-base-content/50",children:"📥 Fresh input:"}),a.jsx("span",{children:xr(s)}),a.jsx("span",{className:"text-base-content/50",children:"💾 Cache read:"}),a.jsx("span",{className:"text-cyan-400",children:xr(i)}),a.jsx("span",{className:"text-base-content/50",children:"📤 Output:"}),a.jsx("span",{children:xr(o)}),a.jsx("span",{className:"text-base-content/50 border-t border-base-content/10 pt-0.5",children:"⚡ Total load:"}),a.jsx("span",{className:"font-bold border-t border-base-content/10 pt-0.5 text-primary",children:xr(m)})]})]})]})]})},rx=({item:e,categoryColor:t,label:n,badgePrefix:r,size:s="sm",className:i="",testId:o,tooltipId:l,onClick:u})=>{const[c,d]=g.useState(!1),[p,f]=g.useState(!1),[m,b]=g.useState(!1),[x,y]=g.useState(!1),E=g.useRef(null),v=e.category??xv(e.toolName),S=t??Dl[v]??Dl.other,A=e.seq??e.toolSeq??1,N=l||`tool-tooltip-${A}-${e.toolName}`,T=g.useMemo(()=>{if(!e.argsRaw)return null;try{const q=JSON.parse(e.argsRaw);return JSON.stringify(q,null,2)}catch{return e.argsRaw}},[e.argsRaw]),w=async q=>{if(q.stopPropagation(),!!T)try{await navigator.clipboard.writeText(T),b(!0),setTimeout(()=>b(!1),2e3)}catch{}},k=async q=>{if(q.stopPropagation(),!!e.errorText)try{await navigator.clipboard.writeText(e.errorText),y(!0),setTimeout(()=>y(!1),2e3)}catch{}},F=()=>{E.current&&(clearTimeout(E.current),E.current=null)},C=()=>{F(),d(!0)},$=()=>{p||(F(),E.current=setTimeout(()=>{d(!1)},150))},z=q=>{q.stopPropagation(),f(re=>!re),d(!0),u?.(q)},M=c||p,G=e.status==="error",H=s==="xs"?"px-1.5 py-0.2 text-[10px]":s==="md"?"px-2.5 py-1 text-xs":"px-2 py-0.5 text-[11px]",j=n??`${r??""}${e.toolName}`;return a.jsxs("div",{className:`relative inline-flex items-center ${i}`,children:[a.jsx("button",{type:"button","aria-describedby":N,className:`${H} rounded-md font-mono font-bold text-white shrink-0 tracking-wide cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-primary shadow-xs transition-opacity hover:opacity-90`,style:{backgroundColor:S},onClick:z,onMouseEnter:C,onMouseLeave:$,onFocus:()=>{F(),d(!0)},onBlur:()=>{p||d(!1)},onKeyDown:q=>{q.key==="Escape"&&(f(!1),d(!1))},"data-testid":o??`tool-tag-${A}`,children:j}),a.jsxs("div",{id:N,role:"tooltip","data-testid":l??`tool-tooltip-${A}`,"data-inspector-tooltip":"true",className:`absolute left-0 top-full mt-2 z-50 w-[880px] max-w-[95vw] bg-base-300 border border-base-content/20 shadow-2xl rounded-xl p-4 text-xs font-mono text-base-content backdrop-blur-md flex flex-col gap-3 pointer-events-auto select-text cursor-default ${M?"block":"hidden"}`,onMouseEnter:()=>{F(),d(!0)},onMouseLeave:$,onClick:q=>q.stopPropagation(),onKeyDown:q=>{q.key==="Escape"&&(f(!1),d(!1)),q.stopPropagation()},children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-base-content/10 pb-2.5",children:[a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[a.jsx("span",{className:"px-2.5 py-0.5 rounded-md text-xs font-bold text-white shrink-0 tracking-wide",style:{backgroundColor:S},children:e.toolName}),a.jsxs("span",{className:"text-xs text-base-content/50 font-bold",children:["#",A]}),a.jsxs("span",{className:"text-[11px] text-base-content/60 uppercase tracking-wider",children:["(",v,")"]})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:`px-2.5 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider ${G?"bg-error/20 text-error":"bg-success/20 text-success"}`,children:e.status??"ok"}),p&&a.jsx("button",{type:"button",className:"text-base-content/50 hover:text-base-content text-xs p-1 leading-none rounded hover:bg-base-content/10 cursor-pointer",onClick:q=>{q.stopPropagation(),f(!1),d(!1)},title:"Close tooltip",children:"✕"})]})]}),e.errorText&&a.jsxs("div",{className:"bg-error/10 text-error border border-error/20 rounded-lg p-2.5 text-xs",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("span",{className:"font-bold",children:"Execution Error:"}),a.jsx("button",{type:"button",className:"px-1.5 py-0.5 rounded text-[10px] bg-error/20 hover:bg-error/30 transition-colors cursor-pointer",onClick:k,children:x?"✓ Copied":"Copy"})]}),a.jsx("pre",{className:"font-mono text-[11px] whitespace-pre-wrap max-h-36 overflow-y-auto",children:e.errorText})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-[11px] font-semibold text-base-content/70",children:["Arguments (raw)"," ",a.jsx("span",{className:"text-base-content/40 font-normal",children:"(syntax-highlighted)"})]}),T&&a.jsx("button",{type:"button",className:"px-2 py-0.5 rounded text-[10px] font-mono text-base-content/70 hover:text-base-content hover:bg-base-content/10 transition-colors cursor-pointer border border-base-content/10",onClick:w,children:m?"✓ Copied":"Copy"})]}),T?a.jsx("div",{className:"bg-base-100 p-3 rounded-lg text-[11px] font-mono overflow-x-auto max-h-60 border border-base-content/10 whitespace-pre-wrap break-all text-base-content/90 overflow-y-auto",children:a.jsx(BG,{code:T,toolName:e.toolName})}):a.jsxs("div",{className:"p-2.5 bg-base-100/50 rounded-lg text-xs text-base-content/50 italic border border-base-content/10",children:["Raw payload omitted at import; digest available: ",e.argsDigest??"—"]}),e.argsDigest&&e.argsDigest!==e.argsRaw&&a.jsxs("div",{className:"text-[10px] text-base-content/50 truncate mt-0.5",children:[a.jsx("span",{className:"font-semibold",children:"Digest: "}),e.argsDigest]})]}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 text-xs font-mono bg-base-200/70 p-2.5 rounded-lg border border-base-content/10",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"DURATION"}),a.jsx("span",{className:"text-[11px]",children:e.durationMs!==null&&e.durationMs!==void 0?`${e.durationMs} ms (${e.durationSource??"measured"})`:`— (${e.durationSource??"unmeasured"})`})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"TIMESTAMP"}),a.jsx("span",{className:"text-[11px] truncate block",children:e.ts??"—"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"SOURCE / MODEL"}),a.jsxs("span",{className:"text-[11px] truncate block",title:`${e.source??"—"} / ${e.model??"—"}`,children:[e.source??"—"," / ",e.model??"—"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"SESSION ID"}),a.jsx("span",{className:"text-[11px] truncate block",title:e.sessionId??"—",children:e.sessionId??"—"})]}),e.callId&&a.jsxs("div",{className:"col-span-2 md:col-span-4",children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"CALL ID"}),a.jsx("span",{className:"text-[11px] truncate block",title:e.callId,children:e.callId})]}),e.tokens&&a.jsxs("div",{className:"col-span-2 md:col-span-4 pt-1 border-t border-base-content/10",children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"TOKEN LOAD (SHARE)"}),a.jsxs("span",{className:"text-[11px]",children:["Billed: ",xr(e.tokens.billedTokens)," (Fresh:"," ",xr(e.tokens.freshInputTokens),", Cache:"," ",xr(e.tokens.cacheReadTokens),", Output:"," ",xr(e.tokens.outputTokens),")"]})]})]})]})]})},$G=rx,zG=({calls:e,fromSeq:t=1,toSeq:n=1,toolName:r,sessionId:s,maxVisible:i=12,className:o=""})=>{const[l,u]=g.useState(!1),c=g.useMemo(()=>{if(e&&e.length>0)return e;const f=[],m=Math.max(1,n-t+1);for(let b=0;b<m;b++)f.push({seq:t+b,toolSeq:t+b,toolName:r,sessionId:s,category:xv(r),status:"ok"});return f},[e,t,n,r,s]),d=l?c:c.slice(0,i),p=c.length-d.length;return a.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 ${o}`,children:[d.map(f=>a.jsx(rx,{item:f,label:`#${f.seq}`,size:"xs"},`${f.sessionId}-${f.seq}-${f.callId??""}`)),p>0&&a.jsxs("button",{type:"button",className:"px-2 py-0.5 rounded text-[10px] font-mono font-bold bg-base-content/10 text-base-content/70 hover:bg-base-content/20 transition-colors cursor-pointer",onClick:()=>u(!0),children:["+",p," more"]}),l&&c.length>i&&a.jsx("button",{type:"button",className:"px-2 py-0.5 rounded text-[10px] font-mono font-bold bg-base-content/10 text-base-content/70 hover:bg-base-content/20 transition-colors cursor-pointer",onClick:()=>u(!1),children:"Show less"})]})};function jE(e){const t=e.toLowerCase();return t.includes("read")||t.includes("view")||t.includes("cat")?"read":t.includes("write")||t.includes("edit")||t.includes("replace")||t.includes("patch")?"write":t.includes("bash")||t.includes("command")||t.includes("exec")||t.includes("terminal")?"bash":t.includes("grep")||t.includes("find")||t.includes("search")||t.includes("glob")?"search":t.includes("mcp")?"mcp":"other"}const Sv=({data:e,loading:t,error:n,cacheHitTrend:r,onSelectSession:s})=>{const[i,o]=g.useState("model"),[l,u]=g.useState("asc"),c=g.useMemo(()=>({"claude-opus-4.6":"#3987e5","claude-sonnet-4.6":"#199e70","gpt-5.6-sol":"#9085e9","grok-4.6":"#d95926",other:"#898781"}),[]),d=g.useMemo(()=>["Speed","Cache Ratio","Reliability","Output Ratio"],[]);if(t)return a.jsxs("div",{className:"flex flex-col items-center justify-center p-20 gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-full border-3 border-primary border-t-transparent animate-spin"}),a.jsx("span",{className:"text-xs font-mono text-base-content/60",children:"Analyzing operational insights..."})]});if(n)return a.jsxs("div",{className:"p-5 rounded-xl bg-error/10 border border-error/20 text-error flex items-center gap-3",children:[a.jsx("span",{className:"text-lg",children:"⚠️"}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-sm",children:"Failed to load insights"}),a.jsx("p",{className:"text-xs opacity-80",children:n})]})]});if(!e)return null;const{loops:p,cacheWaste:f,heavySessions:m,largestTokenSteps:b,slowSteps:x,modelComparison:y}=e,E=j=>{i===j?u(q=>q==="asc"?"desc":"asc"):(o(j),u(j==="model"?"asc":"desc"))},v=[...y].sort((j,q)=>{const re=l==="asc"?1:-1;return i==="model"?re*j.model.localeCompare(q.model):re*((j[i]??0)-(q[i]??0))}),S=j=>i!==j?a.jsx("span",{className:"opacity-30 ml-1 text-[10px]",children:"↕"}):a.jsx("span",{className:"text-primary ml-1 text-[10px]",children:l==="asc"?"▲":"▼"}),A=Math.max(1,...m.map(j=>j.tokens)),N=Math.max(1,...x.map(j=>j.durationMs??0)),T=p.reduce((j,q)=>j+(q.wastedTokens??0),0),w=f.reduce((j,q)=>j+(q.freshTokens??0),0),k=x[0],F=b[0],C=y.map(j=>j.speedMsMean),$=C.length>0?Math.min(...C):0,z=C.length>0?Math.max(...C):0,M=j=>z===$?100:Math.max(0,Math.min(100,Math.round((z-j)/(z-$)*100))),G=j=>Math.max(0,Math.min(100,Math.round(j*100))),H=y.map(j=>{const q=M(j.speedMsMean),re=G(j.cacheRatio),pe=G(j.reliability),I=G(j.outputRatio*5);return{label:j.model,color:c[j.model]??"#3987e5",values:[q,re,pe,I]}});return a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:`rounded-xl p-4 border flex flex-col justify-between transition-all ${p.length>0?"bg-warning/10 border-warning/30 text-warning":"bg-base-200 border-base-content/10"}`,children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Loop Anomalies"}),a.jsx("span",{children:p.length>0?"⚠️":"✓"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsxs("div",{className:"text-xl font-bold font-mono",children:[p.length," ",p.length===1?"incident":"incidents"]}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:p.length>0?`${Ce(T)} wasted tokens`:"Clean execution"})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Cache Waste"}),a.jsx("span",{className:"text-cyan-400",children:"⚡"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-error",children:Ce(w)}),a.jsxs("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:["Across ",f.length," un-cached steps"]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Peak Step Tokens"}),a.jsx("span",{className:"text-primary",children:"📊"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-primary",children:F?Ce(F.tokens):"—"}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5 truncate",children:F?`${F.toolName} (#${F.stepIndex})`:"No outlier steps"})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Peak Latency"}),a.jsx("span",{className:"text-amber-400",children:"⏱️"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-amber-400",children:k?.durationMs?Hs(k.durationMs):"—"}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5 truncate",children:k?`${k.toolName} (#${k.stepIndex})`:"No slow steps"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsx("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5 flex flex-col justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Top Cache-Wasting Incidents"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[f.length," incidents"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Steps that re-sent full context without cache hits"}),a.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-3 items-start",children:[(r?.length??0)>1&&a.jsxs("div",{"data-testid":"cache-hit-trend-chart",className:"p-3 bg-base-300/40 rounded-xl border border-base-content/5",children:[a.jsx("div",{className:"text-[10px] font-mono text-base-content/60 uppercase tracking-wider mb-2",children:"Cache Hit Ratio Trend"}),a.jsx(CG,{points:(r??[]).map(j=>({id:j.day,label:j.day.slice(5),v:j.cacheHitRatio})),color:"#22d3ee",height:130})]}),a.jsx("div",{className:"overflow-x-auto w-full",children:f.length>0?a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Session"}),a.jsx("th",{className:"py-1.5 text-right",children:"Fresh Tokens"}),a.jsx("th",{className:"py-1.5 pl-3",children:"Cause"})]})}),a.jsx("tbody",{children:f.map(j=>a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30 transition-colors",children:[a.jsx("td",{className:"py-1.5",children:a.jsxs("button",{type:"button",className:"text-primary hover:underline font-mono inline-flex items-center gap-1 cursor-pointer",onClick:()=>s?.(j.sessionId),title:`Jump to session ${j.sessionId}`,children:[a.jsx("span",{children:j.sessionId}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]})}),a.jsx("td",{className:"py-1.5 text-right text-error font-bold whitespace-nowrap",children:Ce(j.freshTokens)}),a.jsx("td",{className:"py-1.5 pl-3 text-base-content/70 truncate max-w-[140px]",title:j.reason,children:j.reason})]},`${j.sessionId}-${j.freshTokens}-${j.timestamp}`))})]}):a.jsx("div",{className:"p-6 text-center text-xs font-mono text-base-content/50",children:"✓ No cache-wasting incidents detected"})})]})]})}),a.jsx("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5 flex flex-col justify-between",children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Heaviest Token Sessions"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[m.length," sessions"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Sessions consuming highest billed volume"}),a.jsx("div",{className:"flex flex-col gap-3",children:m.length>0?m.map(j=>a.jsxs("div",{className:"p-3 bg-base-300/40 rounded-xl border border-base-content/5 flex flex-col gap-1.5 hover:bg-base-300/70 transition-colors",children:[a.jsxs("div",{className:"flex justify-between items-center text-xs font-mono",children:[a.jsxs("button",{type:"button",className:"text-primary hover:underline font-bold inline-flex items-center gap-1.5 cursor-pointer text-left",onClick:()=>s?.(j.id,j.source),title:`Jump to session ${j.id}`,children:[a.jsx("span",{children:j.id}),a.jsxs("span",{className:"text-[10px] font-normal px-1.5 py-0.2 rounded bg-base-content/10 text-base-content/70",children:[j.source," · ",j.model]}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]}),a.jsx("span",{className:"font-bold",children:Ce(j.tokens)})]}),a.jsx(fi,{value:j.tokens,max:A,color:"#3987e5",height:6})]},j.id)):a.jsx("div",{className:"p-8 text-center text-xs font-mono text-base-content/50",children:"No heavy sessions recorded in this timeframe"})})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Top Time-Consuming Steps"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[x.length," steps"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Longest tool execution durations"}),a.jsx("div",{className:"overflow-x-auto",children:x.length>0?a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Tool / Step"}),a.jsx("th",{className:"py-1.5",children:"Session"}),a.jsx("th",{className:"py-1.5 text-right",children:"Duration"}),a.jsx("th",{className:"py-1.5 text-right",children:"Tokens"})]})}),a.jsx("tbody",{children:x.map(j=>{const q=jE(j.toolName),re=Gs[q]??Gs.other;return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30 transition-colors",children:[a.jsxs("td",{className:"py-1.5 font-bold",children:[a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[11px] border gap-1 mr-1.5 ${re}`,children:j.toolName}),a.jsxs("span",{className:"text-[10px] text-base-content/50",children:["#",j.stepIndex]})]}),a.jsx("td",{className:"py-1.5",children:a.jsxs("button",{type:"button",className:"text-primary hover:underline inline-flex items-center gap-1 cursor-pointer",onClick:()=>s?.(j.sessionId,j.agent),title:`Jump to session ${j.sessionId}`,children:[a.jsx("span",{children:j.sessionId}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]})}),a.jsx("td",{className:"py-1.5 text-right text-amber-400 font-bold w-24",children:a.jsxs("div",{className:"flex flex-col items-end gap-1",children:[a.jsx("span",{children:Hs(j.durationMs??0)}),a.jsx(fi,{value:j.durationMs??0,max:N,color:"#fbbf24",height:4})]})}),a.jsx("td",{className:"py-1.5 text-right tabular-nums",children:Ce(j.tokens)})]},`${j.sessionId}-${j.toolName}-${j.stepIndex}`)})})]}):a.jsx("div",{className:"p-8 text-center text-xs font-mono text-base-content/50",children:"No slow steps recorded"})})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Largest Token Steps"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[b.length," steps"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-3",children:"Single tool calls with highest token load"}),a.jsx("div",{className:"overflow-x-auto",children:b.length>0?a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Tool / Step"}),a.jsx("th",{className:"py-1.5",children:"Session"}),a.jsx("th",{className:"py-1.5",children:"Agent / Model"}),a.jsx("th",{className:"py-1.5 text-right",children:"Tokens"})]})}),a.jsx("tbody",{children:b.map(j=>{const q=jE(j.toolName),re=Gs[q]??Gs.other;return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30 transition-colors",children:[a.jsxs("td",{className:"py-1.5 font-bold",children:[a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[11px] border gap-1 mr-1.5 ${re}`,children:j.toolName}),a.jsxs("span",{className:"text-[10px] text-base-content/50",children:["#",j.stepIndex]})]}),a.jsx("td",{className:"py-1.5",children:a.jsxs("button",{type:"button",className:"text-primary hover:underline inline-flex items-center gap-1 cursor-pointer",onClick:()=>s?.(j.sessionId,j.agent),title:`Jump to session ${j.sessionId}`,children:[a.jsx("span",{children:j.sessionId}),a.jsx("span",{className:"text-[10px] opacity-60",children:"↗"})]})}),a.jsx("td",{className:"py-1.5 text-xs text-base-content/70",children:a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-base-300 text-[11px]",children:[j.agent," · ",j.model]})}),a.jsx("td",{className:"py-1.5 text-right text-primary font-bold tabular-nums",children:Ce(j.tokens)})]},`${j.sessionId}-${j.toolName}-${j.stepIndex}`)})})]}):a.jsx("div",{className:"p-8 text-center text-xs font-mono text-base-content/50",children:"No large token step outliers found"})})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-1",children:[a.jsx("h4",{className:"font-bold text-sm",children:"Model Multi-Axis Comparison"}),a.jsxs("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2 py-0.5 rounded-full",children:[y.length," models evaluated"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-4",children:"Evaluation across Speed, Cache ratio, Reliability, and Output ratio"}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 items-center",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center p-3 bg-base-300/30 rounded-xl border border-base-content/5",children:[a.jsx(IG,{axes:d,series:H,height:280}),a.jsx("div",{className:"flex flex-wrap items-center justify-center gap-3 mt-3",children:H.map(j=>a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-mono text-base-content/80 px-2 py-0.5 rounded-full bg-base-300 border border-base-content/10",children:[a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:j.color}}),j.label]},j.label))})]}),a.jsx("div",{className:"overflow-x-auto w-full",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsxs("th",{className:"py-2 cursor-pointer select-none hover:text-base-content",onClick:()=>E("model"),children:["Model ",S("model")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("speedMsMean"),children:["Mean Speed (ms) ",S("speedMsMean")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("cacheRatio"),children:["Cache Ratio ",S("cacheRatio")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("reliability"),children:["Reliability ",S("reliability")]}),a.jsxs("th",{className:"py-2 text-right cursor-pointer select-none hover:text-base-content",onClick:()=>E("outputRatio"),children:["Output Ratio ",S("outputRatio")]})]})}),a.jsx("tbody",{children:v.map(j=>a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/40 transition-colors",children:[a.jsxs("td",{className:"py-2 font-bold flex items-center gap-2",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full shrink-0 shadow-xs",style:{background:c[j.model]??"#3987e5"}}),a.jsx("span",{className:"truncate",children:j.model})]}),a.jsx("td",{className:"py-2 text-right font-mono tabular-nums",children:Ct(j.speedMsMean)}),a.jsx("td",{className:"py-2 text-right font-mono tabular-nums text-cyan-400 font-bold",children:Wn(j.cacheRatio*100)}),a.jsx("td",{className:`py-2 text-right font-mono tabular-nums font-bold ${j.reliability>=.95?"text-emerald-400":j.reliability>=.8?"text-amber-400":"text-error"}`,children:Wn(j.reliability*100)}),a.jsx("td",{className:"py-2 text-right font-mono tabular-nums text-base-content/80",children:Wn(j.outputRatio*100)})]},j.model))})]})})]})]}),p.length>0&&a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-warning/30 p-5",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-warning text-lg",children:"⚠️"}),a.jsx("h3",{className:"font-bold text-base",children:"Detected Execution Loops (Repeats ≥ 3)"})]}),a.jsxs("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-warning/20 text-warning border border-warning/30",children:[p.length," loop ",p.length===1?"pattern":"patterns"," detected"]})]}),a.jsx("p",{className:"text-xs text-base-content/60 mb-4",children:"Identified consecutive identical tool invocations without intervening state changes. Hover or click on any invocation badge to inspect full arguments, duration, and diagnostics."}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:p.map(j=>a.jsxs("div",{className:"p-4 bg-base-300/70 rounded-xl border border-base-content/10 flex flex-col justify-between gap-3 shadow-xs hover:border-warning/40 transition-colors",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-warning/20 text-warning border border-warning/30",children:[j.tool," × ",j.repeats," repeats"]}),a.jsxs("button",{type:"button",className:"text-xs font-mono text-primary hover:underline cursor-pointer inline-flex items-center gap-1 font-bold",onClick:()=>s?.(j.sessionId),title:"Jump to session in Tool Using & Timeline",children:[j.sessionId," →"]})]}),a.jsxs("div",{className:"font-mono text-xs text-base-content/80 mt-2 p-2 bg-base-200/80 rounded-lg border border-base-content/5 truncate",title:j.argsHint,children:[a.jsx("span",{className:"text-[10px] text-base-content/50 block mb-0.5 uppercase tracking-wider",children:"Argument signature"}),j.argsHint==="74234e98afe7498fb5daf1f36ac2d78acc339464f950703b8c019892f982b90b"?"empty/unrecorded arguments":j.argsHint]}),a.jsxs("div",{className:"text-[11px] font-mono text-base-content/60 mt-2",children:["Step sequence: #",j.fromSeq," → #",j.toSeq]}),a.jsxs("div",{className:"mt-3 pt-2.5 border-t border-base-content/10",children:[a.jsx("div",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50 mb-1.5",children:"Repeated Invocations (hover/click for details):"}),a.jsx(zG,{calls:j.repeatedCalls,fromSeq:j.fromSeq,toSeq:j.toSeq,toolName:j.tool,sessionId:j.sessionId})]})]}),a.jsxs("div",{className:"flex justify-between items-center text-xs font-mono pt-2 border-t border-base-content/10 bg-base-200/40 -mx-4 -mb-4 p-3 rounded-b-xl",children:[a.jsx("span",{className:"text-base-content/60",children:"Estimated Wasted Tokens:"}),a.jsx("span",{className:"text-error font-bold text-sm",children:Ce(j.wastedTokens)})]})]},`${j.tool}-${j.sessionId}-${j.fromSeq}`))})]})]})};function HG(e){const t=e.toLowerCase();return t.includes("read")||t.includes("view")||t.includes("cat")?"read":t.includes("write")||t.includes("edit")||t.includes("replace")||t.includes("patch")?"write":t.includes("bash")||t.includes("command")||t.includes("exec")||t.includes("terminal")?"bash":t.includes("grep")||t.includes("find")||t.includes("search")||t.includes("glob")?"search":t.includes("mcp")?"mcp":"other"}const Tv=({data:e,loading:t,error:n,sortBy:r="start",sortDir:s="desc",page:i=1,pageSize:o=20,onSortChange:l,onPageChange:u,onSelectSession:c})=>{const[d,p]=g.useState(""),[f,m]=g.useState("all");if(t)return a.jsxs("div",{className:"flex flex-col items-center justify-center p-20 gap-3",children:[a.jsx("div",{className:"w-9 h-9 rounded-full border-3 border-primary border-t-transparent animate-spin"}),a.jsx("span",{className:"text-xs font-mono text-base-content/60",children:"Loading session records..."})]});if(n)return a.jsxs("div",{className:"p-5 rounded-xl bg-error/10 border border-error/20 text-error flex items-center gap-3",children:[a.jsx("span",{className:"text-lg",children:"⚠️"}),a.jsxs("div",{children:[a.jsxs("h5",{className:"font-bold text-sm",children:["Failed to load sessions: ",n]}),a.jsx("p",{className:"text-xs opacity-80",children:"Please check your connection and try refreshing."})]})]});if(!e)return null;const{items:b,total:x}=e,y=Math.max(1,Math.ceil(x/o)),E=b.reduce((w,k)=>w+k.billedTokens,0),v=b.reduce((w,k)=>w+k.cacheReadTokens,0),S=b.filter(w=>w.state==="error").length,A=Math.max(1,...b.map(w=>w.billedTokens)),N=b.filter(w=>{if(f!=="all"&&w.state!==f)return!1;if(!d.trim())return!0;const k=d.toLowerCase();return w.id.toLowerCase().includes(k)||w.source.toLowerCase().includes(k)||w.model.toLowerCase().includes(k)||w.topTool.toLowerCase().includes(k)}),T=w=>r!==w?a.jsx("span",{className:"opacity-25 ml-1 text-[10px]",children:"↕"}):a.jsx("span",{className:"ml-1 text-primary font-bold",children:s==="asc"?"▲":"▼"});return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Total Sessions"}),a.jsx("span",{className:"text-primary",children:"📋"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-base-content",children:Ct(x)}),a.jsxs("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:["Showing page ",i," of ",y]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Page Billed Tokens"}),a.jsx("span",{className:"text-primary",children:"⚡"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-primary",children:Ce(E)}),a.jsxs("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:["Across ",b.length," page sessions"]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col justify-between",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Page Cache Read"}),a.jsx("span",{className:"text-cyan-400",children:"💾"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsx("div",{className:"text-xl font-bold font-mono text-cyan-400",children:Ce(v)}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:"Reused context tokens"})]})]}),a.jsxs("div",{className:`rounded-xl p-4 border flex flex-col justify-between transition-all ${S>0?"bg-error/10 border-error/30 text-error":"bg-base-200 border-base-content/10"}`,children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-[11px] font-mono uppercase tracking-wider text-base-content/60",children:"Session Status"}),a.jsx("span",{children:S>0?"⚠️":"✓"})]}),a.jsxs("div",{className:"mt-2",children:[a.jsxs("div",{className:"text-xl font-bold font-mono",children:[b.length-S," OK · ",S," Error"]}),a.jsx("div",{className:"text-[11px] text-base-content/60 font-mono mt-0.5",children:S===0?"100% successful on page":`${S} failed sessions`})]})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 bg-base-200 p-3 rounded-xl border border-base-content/10",children:[a.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-[200px]",children:[a.jsx("span",{className:"text-base-content/40 text-xs",children:"🔍"}),a.jsx("input",{type:"text",placeholder:"Filter sessions by ID, model, agent, or tool...",value:d,onChange:w=>p(w.target.value),className:"bg-base-300/60 text-xs font-mono px-3 py-1.5 rounded-lg border border-base-content/10 w-full focus:outline-hidden focus:border-primary placeholder:text-base-content/40"}),d&&a.jsx("button",{type:"button",onClick:()=>p(""),className:"text-xs text-base-content/50 hover:text-base-content cursor-pointer",children:"✕"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-mono",children:[a.jsx("span",{className:"text-base-content/50 text-[11px] uppercase tracking-wider mr-1",children:"State:"}),["all","ok","error"].map(w=>a.jsx("button",{type:"button",onClick:()=>m(w),className:`px-2.5 py-1 rounded-md text-xs uppercase font-bold transition-colors cursor-pointer ${f===w?"bg-primary text-primary-content shadow-xs":"bg-base-300 text-base-content/70 hover:bg-base-300/80"}`,children:w},w))]})]}),a.jsx("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 overflow-hidden",children:a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-base-300/80 text-base-content/70 border-b border-base-content/10 select-none",children:[a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Session ID"}),a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Agent"}),a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Model"}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors whitespace-nowrap",onClick:()=>l?.("start"),children:["Start Time ",T("start")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("duration"),children:["Duration ",T("duration")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("messages"),children:["Msgs ",T("messages")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("toolCalls"),children:["Tools ",T("toolCalls")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("billedTokens"),children:["Billed Tok ",T("billedTokens")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("cacheRead"),children:["Cache Read ",T("cacheRead")]}),a.jsxs("th",{className:"p-3 cursor-pointer hover:text-primary transition-colors text-right whitespace-nowrap",onClick:()=>l?.("freshInput"),children:["Fresh Input ",T("freshInput")]}),a.jsx("th",{className:"p-3 whitespace-nowrap",children:"Top Tool"}),a.jsx("th",{className:"p-3 text-center whitespace-nowrap",children:"State"})]})}),a.jsx("tbody",{children:N.length===0?a.jsx("tr",{children:a.jsx("td",{colSpan:12,className:"text-center py-12 text-base-content/50",children:"No sessions matching the current filter."})}):N.map(w=>{const k=HG(w.topTool),F=Gs[k]??Gs.other,C=Math.min(100,Math.round(w.billedTokens/A*100));return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-primary/10 cursor-pointer transition-colors group",onClick:()=>c?.(w.source,w.id),title:"Click to view execution timeline",children:[a.jsx("td",{className:"p-3 font-bold text-primary whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"font-mono text-xs",title:w.id,children:w.id.length>18?`${w.id.slice(0,16)}…`:w.id}),a.jsx("span",{className:"text-[10px] opacity-40 group-hover:opacity-100 transition-opacity",children:"↗"})]})}),a.jsx("td",{className:"p-3 whitespace-nowrap",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded text-[11px] bg-base-300 border border-base-content/10 font-mono text-base-content",children:[a.jsx("span",{className:"w-3.5 h-3.5 flex items-center justify-center opacity-80",children:a.jsx(or,{id:w.source})}),a.jsx("span",{children:w.source})]})}),a.jsx("td",{className:"p-3 text-base-content/80 whitespace-nowrap",children:a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-base-300/60 border border-base-content/5 text-[11px]",children:w.model})}),a.jsx("td",{className:"p-3 font-mono text-xs text-base-content/70 whitespace-nowrap",children:_G(w.start)}),a.jsx("td",{className:"p-3 text-right font-semibold tabular-nums whitespace-nowrap",children:fv(w.durationMs/6e4)}),a.jsx("td",{className:"p-3 text-right tabular-nums text-base-content/80 whitespace-nowrap",children:Ct(w.messages)}),a.jsx("td",{className:"p-3 text-right tabular-nums text-base-content/80 whitespace-nowrap",children:Ct(w.toolCalls)}),a.jsx("td",{className:"p-3 text-right font-bold text-primary tabular-nums whitespace-nowrap",children:a.jsxs("div",{className:"flex flex-col items-end gap-0.5",children:[a.jsx("span",{children:Ce(w.billedTokens)}),a.jsx("div",{className:"w-12 bg-base-300 h-1 rounded-full overflow-hidden",children:a.jsx("div",{className:"bg-primary h-full rounded-full",style:{width:`${C}%`}})})]})}),a.jsx("td",{className:"p-3 text-right text-cyan-400 font-bold tabular-nums whitespace-nowrap",children:Ce(w.cacheReadTokens)}),a.jsx("td",{className:"p-3 text-right text-base-content/70 tabular-nums whitespace-nowrap",children:Ce(w.freshInputTokens)}),a.jsx("td",{className:"p-3 whitespace-nowrap",children:a.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-[10px] border font-mono ${F}`,children:w.topTool})}),a.jsx("td",{className:"p-3 text-center whitespace-nowrap",children:a.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-mono font-bold border ${w.state==="error"?"bg-error/15 text-error border-error/30":w.state==="running"?"bg-cyan-500/15 text-cyan-400 border-cyan-500/30 animate-pulse":"bg-emerald-500/15 text-emerald-400 border-emerald-500/30"}`,children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-current"}),w.state]})})]},`${w.source}:::${w.id}`)})})]})})}),a.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-3 px-2 py-1 text-xs",children:[a.jsxs("span",{className:"text-base-content/70 font-mono text-[11px]",children:["Showing ",(i-1)*o+1,"–",Math.min(i*o,x)," of ",x," sessions"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded-lg border border-base-content/20 hover:bg-base-content/10 font-medium disabled:opacity-40 disabled:hover:bg-transparent cursor-pointer transition-colors",disabled:i<=1,onClick:()=>u?.(i-1),children:"« Previous"}),a.jsxs("span",{className:"px-3 py-1.5 text-xs font-mono bg-base-300 rounded-lg border border-base-content/10 text-base-content font-bold",children:[i," / ",y]}),a.jsx("button",{type:"button",className:"px-3 py-1.5 text-xs rounded-lg border border-base-content/20 hover:bg-base-content/10 font-medium disabled:opacity-40 disabled:hover:bg-transparent cursor-pointer transition-colors",disabled:i>=y,onClick:()=>u?.(i+1),children:"Next »"})]})]})]})},Nv=({data:e,loading:t,error:n,onTriggerImport:r})=>{const[s,i]=g.useState(!1),[o,l]=g.useState(null),u=async()=>{i(!0),l("Running import & analytics rollup...");try{const m=await r?.("incremental");l(m?.message??"Import queued.")}catch(m){l(`Import failed: ${m instanceof Error?m.message:String(m)}`)}finally{i(!1)}};if(t)return a.jsx("div",{className:"flex items-center justify-center p-16",children:a.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-primary border-t-transparent animate-spin"})});if(n)return a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error",children:a.jsxs("span",{children:["Failed to load sources registry: ",n]})});if(!e)return null;const{overview:c,agents:d,roots:p}=e,f=d[0]?.heatmapDays.length;return a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xl",children:"🗄️"}),a.jsx("h3",{className:"font-bold text-base",children:"Transcripts Corpus & Ingestion Registry"})]}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-xs font-mono text-base-content/70 mt-1",children:[a.jsxs("span",{children:["Files: ",a.jsx("strong",{className:"text-base-content",children:Ct(c.totalFiles)})]}),a.jsxs("span",{children:["Corpus Size:"," ",a.jsxs("strong",{className:"text-base-content",children:[(c.corpusSizeBytes/(1024*1024)).toFixed(1)," MB"]})]}),a.jsxs("span",{children:["Total Sessions:"," ",a.jsx("strong",{className:"text-base-content",children:Ct(c.totalSessions)})]}),a.jsxs("span",{children:["Coverage:"," ",a.jsxs("strong",{className:"text-base-content",children:[c.dateCoverage.from?.slice(0,10)??"N/A"," →"," ",c.dateCoverage.to?.slice(0,10)??"N/A"]})]}),a.jsxs("span",{children:["Last Import:"," ",a.jsx("strong",{className:"text-base-content",children:c.lastImportedAt?new Date(c.lastImportedAt).toLocaleString():"never imported"})]})]})]}),a.jsxs("div",{className:"flex flex-col items-end gap-1.5",children:[a.jsx("button",{type:"button",className:"px-4 py-2 rounded-lg bg-primary text-primary-content font-medium text-xs hover:bg-primary/90 transition-colors disabled:opacity-50",disabled:s,onClick:u,children:s?"Importing...":"🔄 Import & Analyze"}),o&&a.jsx("span",{className:"text-[11px] font-mono text-info","aria-live":"polite",children:o})]})]}),a.jsxs("div",{children:[a.jsxs("h4",{className:"font-bold text-sm mb-3",children:["Agent Activity (",f??"—","-Day Daily Heatmaps)"]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4",children:d.map(m=>a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 hover:border-base-content/30 transition-all p-4 flex flex-col justify-between gap-3",children:[a.jsxs("div",{className:"flex justify-between items-start",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsxs("div",{className:"relative group",children:[a.jsx("button",{type:"button",className:"w-7 h-7 rounded-lg flex items-center justify-center text-white shadow-xs focus:outline-2 focus:outline-offset-2 focus:outline-primary",style:{background:m.color},"aria-label":`${m.name} source metrics`,"aria-describedby":`source-tooltip-${m.id}`,children:a.jsx(or,{id:m.id})}),a.jsxs("div",{id:`source-tooltip-${m.id}`,role:"tooltip",className:"pointer-events-none absolute z-20 left-0 top-9 w-64 rounded-lg border border-base-content/15 bg-base-100 p-3 text-[11px] font-mono shadow-xl opacity-0 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100",children:[a.jsxs("div",{className:"mb-2 font-bold text-sm",children:[m.name," Summary"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-x-3 gap-y-1",children:[a.jsx("span",{className:"text-base-content/60",children:"Imported Files"}),a.jsx("strong",{className:"text-right",children:Ct(m.filesCount)}),a.jsx("span",{className:"text-base-content/60",children:"Sessions"}),a.jsx("strong",{className:"text-right",children:Ct(m.sessionCount)}),a.jsx("span",{className:"text-base-content/60",children:"Total Tokens"}),a.jsx("strong",{className:"text-right",children:Ce(m.totalTokens)}),a.jsx("span",{className:"text-base-content/60",children:"Cache Saved"}),a.jsx("strong",{className:"text-right",children:Ce(m.cacheSavedTokens)}),a.jsx("span",{className:"text-base-content/60",children:"Tool Calls"}),a.jsx("strong",{className:"text-right",children:Ct(m.toolCalls)}),a.jsx("span",{className:"text-base-content/60",children:"Date Range"}),a.jsxs("strong",{className:"text-right",children:[m.firstDate?.slice(0,10)??"N/A"," →"," ",m.lastDate?.slice(0,10)??"N/A"]})]})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"font-bold text-sm",children:m.name}),a.jsx("div",{className:"text-[10px] font-mono text-base-content/60",children:m.importPath})]})]}),a.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-mono font-bold bg-base-300 border border-base-content/10 text-base-content",children:[Ce(m.totalTokens)," tok"]})]}),a.jsxs("div",{className:"bg-base-300/60 p-2 rounded-lg border border-base-content/5",children:[a.jsxs("div",{className:"text-[10px] font-mono text-base-content/50 mb-1 flex justify-between",children:[a.jsxs("span",{children:[f??"—"," days ago"]}),a.jsx("span",{children:"Today"})]}),a.jsx(DG,{days:m.heatmapDays,color:m.color,maxDailyTokens:m.maxDailyTokens})]}),a.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-2 border-t border-base-content/10 font-mono text-[11px]",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"Sessions"}),a.jsx("span",{className:"font-semibold",children:Ct(m.sessionCount)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"Tool Calls"}),a.jsx("span",{className:"font-semibold",children:Ct(m.toolCalls)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px]",children:"Cache Saved"}),a.jsx("span",{className:"font-semibold text-emerald-400",children:Ce(m.cacheSavedTokens)})]})]})]},m.id))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Source Directories & Import Roots"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Agent"}),a.jsx("th",{className:"py-1.5",children:"Filesystem Path"}),a.jsx("th",{className:"py-1.5",children:"Match Pattern"}),a.jsx("th",{className:"py-1.5 text-right",children:"Files Count"}),a.jsx("th",{className:"py-1.5 text-center",children:"Status"})]})}),a.jsx("tbody",{children:p.map(m=>a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30",children:[a.jsx("td",{className:"py-1.5 font-bold",children:m.agentName}),a.jsx("td",{className:"py-1.5 text-base-content/80",children:m.path}),a.jsx("td",{className:"py-1.5 text-base-content/60",children:m.matchPattern}),a.jsx("td",{className:"py-1.5 text-right font-semibold",children:Ct(m.fileCount)}),a.jsx("td",{className:"py-1.5 text-center",children:a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-emerald-500/20 text-emerald-400 uppercase font-bold",children:m.status})})]},m.agentId))})]})})]})]})},GG=["auto","1m","3m","5m","10m","30m","1h","4h","1d"],Yr=["#3987e5","#199e70","#d95926","#9085e9","#c98500","#ec4899","#8b5cf6","#06b6d4","#f59e0b","#10b981"],WG=(e,t)=>t===void 0||t===0?null:(e-t)/Math.abs(t)*100,Vd=g.memo(({current:e,previous:t,invert:n=!1})=>{const r=WG(e,t);if(r===null)return a.jsx("span",{className:"text-[10px] text-base-content/40",children:"No prior baseline"});const s=r>=0,i=n?!s:s;return a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold font-mono ${i?"bg-emerald-500/15 text-emerald-400":"bg-error/15 text-error"}`,children:[s?"↑ +":"↓ ",Math.abs(r).toFixed(1),"% vs previous period"]})}),$o=g.memo(({label:e,value:t,sub:n,trend:r,trendColor:s,current:i,previous:o,invert:l,badge:u})=>a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:e}),u]}),a.jsxs("div",{className:"flex items-end justify-between gap-2 mt-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold font-mono text-primary",children:t}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[a.jsx(Vd,{current:i,previous:o,invert:l}),a.jsx("span",{className:"text-xs text-base-content/60",children:n})]})]}),r.length>1&&a.jsx(gv,{values:r,color:s,width:100,height:34})]})]})),zo=g.memo(({title:e,description:t,series:n,buckets:r,chartMode:s,onToggleChartMode:i,testId:o})=>{const l=r.length>0&&n.length>0&&r.some(u=>Object.values(u.v).some(c=>c>0));return a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col gap-3 w-full","data-testid":o,children:[a.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-2 pb-2 border-b border-base-content/10",children:[a.jsx("div",{children:a.jsxs("h4",{className:"font-bold text-sm text-base-content flex items-center gap-2",children:[a.jsx(Br,{tip:t,position:"top",className:"cursor-help [&:before]:whitespace-normal [&:before]:max-w-xs [&:before]:text-left [&:before]:text-[11px] [&:before]:font-normal [&:before]:leading-snug z-20","data-testid":o?`${o}-tooltip`:void 0,children:a.jsx("span",{className:"hover:text-primary transition-colors",children:e})}),a.jsxs("span",{className:"text-[11px] font-normal text-base-content/60 font-mono",children:["(",n.length," tracked)"]})]})}),a.jsxs("div",{className:"flex items-center gap-1 bg-base-300 p-0.5 rounded-lg text-xs",children:[a.jsx("button",{type:"button","aria-pressed":s==="chart",className:`px-2.5 py-1 rounded text-[11px] font-medium transition-colors ${s==="chart"?"bg-base-100 text-base-content font-bold shadow-xs":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>s!=="chart"&&i(),children:"Chart"}),a.jsx("button",{type:"button","aria-pressed":s==="table",className:`px-2.5 py-1 rounded text-[11px] font-medium transition-colors ${s==="table"?"bg-base-100 text-base-content font-bold shadow-xs":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>s!=="table"&&i(),children:"Table"})]})]}),a.jsx("div",{className:"min-h-[220px]",children:s==="table"&&r.length>0&&n.length>0?a.jsx("div",{className:"overflow-x-auto max-h-72 overflow-y-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono","data-testid":"summary-bucket-table",children:[a.jsx("thead",{className:"sticky top-0 bg-base-200",children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5 pr-2",children:"Bucket"}),n.map(u=>a.jsx("th",{className:"py-1.5 pr-2 text-right",children:a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx("span",{className:"w-2 h-2 rounded-full inline-block shrink-0",style:{background:u.color}}),u.label]})},u.id)),a.jsx("th",{className:"py-1.5 pr-2 text-right",children:"Total"}),a.jsx("th",{className:"py-1.5 pr-2 text-right",children:"Cache Hit %"}),a.jsx("th",{className:"py-1.5 text-right",children:"Gain Ratio %"})]})}),a.jsx("tbody",{children:r.map(u=>{const c=Object.values(u.v).reduce((d,p)=>d+p,0);return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30",children:[a.jsx("td",{className:"py-1.5 pr-2 font-bold",children:mv(u.id??u.label)}),n.map(d=>a.jsx("td",{className:"py-1.5 pr-2 text-right tabular-nums",children:u.v[d.id]!==void 0?Ce(u.v[d.id]??0):"—"},d.id)),a.jsx("td",{className:"py-1.5 pr-2 text-right tabular-nums font-bold",children:Ce(c)}),a.jsx("td",{className:"py-1.5 pr-2 text-right tabular-nums text-cyan-400",children:u.lineValue!==void 0?`${u.lineValue.toFixed(1)}%`:"—"}),a.jsx("td",{className:"py-1.5 text-right tabular-nums text-amber-400",children:u.secondLineValue!==void 0?`${u.secondLineValue.toFixed(1)}%`:"—"})]},u.id??u.label)})})]})}):l?a.jsx(hv,{buckets:r,series:n,height:220}):r.length>0&&n.length>0?a.jsxs("div",{className:"flex flex-col items-center justify-center h-[220px] text-base-content/50 text-xs font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30 text-center px-4 gap-1",children:[a.jsxs("span",{className:"font-semibold text-base-content/70",children:["No token or call activity recorded for ",e.toLowerCase()," in this time range."]}),a.jsx("span",{className:"text-[11px] text-base-content/40",children:"Activity is unmeasured or zero in this window. Adjust the time range filter or switch to Table view."})]}):a.jsx("div",{className:"flex flex-col items-center justify-center h-[220px] text-base-content/40 text-xs font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30",children:a.jsxs("span",{children:["No ",e.toLowerCase()," activity recorded for this time range."]})})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 pt-1.5 border-t border-base-content/5",children:[n.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1.5",children:n.map(u=>a.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-md bg-base-300/80 border border-base-content/5 gap-1.5 font-mono text-[10px] text-base-content/80",children:[a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:u.color}}),a.jsx("span",{className:"truncate max-w-[150px]",children:u.label})]},u.id))}),a.jsxs("div",{className:"flex items-center gap-3 text-[10px] font-mono text-base-content/70 ml-auto",children:[a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"w-3 h-0.5 bg-cyan-400 rounded-full inline-block"}),a.jsx("span",{className:"text-cyan-400",children:"Cache Hit %"})]}),a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx("span",{className:"w-3 h-0.5 bg-amber-400 rounded-full inline-block"}),a.jsx("span",{className:"text-amber-400",children:"Gain Ratio %"})]})]})]})]})}),Ho=(e,t,n)=>{const r=new Map;e.forEach((i,o)=>{r.set(i.id,{id:i.id,label:i.label||i.id,color:i.color||n[o%n.length]||"#3987e5"})});let s=r.size;for(const i of t)for(const o of Object.keys(i.series))o&&!r.has(o)&&(r.set(o,{id:o,label:o,color:n[s%n.length]||"#3987e5"}),s++);return Array.from(r.values())},Go=e=>e.map(t=>({id:t.bucketStart,label:Rl(t.bucketStart),v:t.series,lineValue:t.cacheHitRatio,secondLineValue:t.gainRatio})),Wc=["#199e70","#3987e5","#d95926","#9085e9","#c98500","#ec4899","#8b5cf6","#06b6d4","#f59e0b","#10b981"],wv=g.memo(({data:e,loading:t,error:n,dimension:r="model",onDimensionChange:s,bucket:i="auto",onBucketChange:o,loopSummary:l})=>{const[u,c]=g.useState("chart"),[d,p]=g.useState({model:"chart",source:"chart",tool:"chart",skill:"chart"}),f=g.useCallback(()=>p(W=>({...W,model:W.model==="chart"?"table":"chart"})),[]),m=g.useCallback(()=>p(W=>({...W,source:W.source==="chart"?"table":"chart"})),[]),b=g.useCallback(()=>p(W=>({...W,tool:W.tool==="chart"?"table":"chart"})),[]),x=g.useCallback(()=>p(W=>({...W,skill:W.skill==="chart"?"table":"chart"})),[]),y=e?.kpis,E=e?.previousKpis,v=e?.kpiTrend??[],S=e?.timeSeries??[],A=e?.topModels??[],N=e?.topSources??[],T=e?.topTools??[],w=g.useMemo(()=>Math.max(0,...A.map(W=>W.tokens),...N.map(W=>W.tokens)),[A,N]),k=e?.skillsUsed??[],F=e?.skillTimeSeries??[],C=e?.skillBreakdown??{bySkill:[],bySource:[],byInvocationKind:[],trend:[],fresh:!0},$=e?.modelTimeSeries??[],z=e?.sourceTimeSeries??[],M=e?.toolTimeSeries??[],G=e?.cacheEfficiency??{savedTokens:0,hitRatio:0,totalRead:0,bySource:[],byModel:[],byAgentModel:[]},H=E??void 0,j=G.byAgentModel??[],q=g.useMemo(()=>Array.from(new Set(j.map(W=>W.model))),[j]),re=g.useMemo(()=>Array.from(new Set(j.map(W=>W.source))),[j]),pe=g.useMemo(()=>new Map(j.map(W=>[`${W.source}\0${W.model}`,W])),[j]),I=g.useMemo(()=>new Map(N.map(W=>[W.id,W.label])),[N]),Z=g.useMemo(()=>({billed:v.map(W=>W.totalBilledTokens),cacheSaved:v.map(W=>W.cacheSavedTokens),sessions:v.map(W=>W.sessionsCount),toolCalls:v.map(W=>W.toolCallsCount)}),[v]),ie=g.useMemo(()=>T.map(W=>({...W,id:W.id&&W.id.trim()!==""?W.id.trim():"unknown"})),[T]),L=g.useMemo(()=>k.filter(W=>W.id&&W.id.trim()!==""&&W.id!=="unknown"),[k]),Ee=g.useMemo(()=>$&&$.length>0?$:r==="model"?S:[],[$,r,S]),fe=g.useMemo(()=>z&&z.length>0?z:r==="source"?S:[],[z,r,S]),Y=g.useMemo(()=>M&&M.length>0?M:r==="tool"?S:[],[M,r,S]),me=g.useMemo(()=>F&&F.length>0?F:r==="skill"?S:[],[F,r,S]),te=g.useMemo(()=>Ho(A,Ee,Yr),[A,Ee]),O=g.useMemo(()=>Ho(N,fe,Yr),[N,fe]),he=g.useMemo(()=>Ho(ie.map((W,_e)=>({id:W.id,label:W.id,color:Wc[_e%Wc.length]})),Y,Wc),[ie,Y]),be=g.useMemo(()=>Ho(L,me,Yr),[L,me]),ye=g.useMemo(()=>Go(Ee),[Ee]),we=g.useMemo(()=>Go(fe),[fe]),Pe=g.useMemo(()=>Go(Y),[Y]),ue=g.useMemo(()=>Go(me),[me]),Ye=g.useMemo(()=>F.map(W=>({id:W.bucketStart,label:Rl(W.bucketStart),v:W.series})),[F]),at=g.useMemo(()=>C.trend.map(W=>({id:W.bucketStart,label:Rl(W.bucketStart),v:W.series})),[C.trend]),Qe=g.useMemo(()=>C.bySkill.map((W,_e)=>({id:W.skillName,label:W.skillName,color:Yr[_e%Yr.length]||"#3987e5"})),[C.bySkill]),{toolCallTotal:At,toolTimeTotal:ft,toolTokenTotal:dt,avgBilledPerSession:Ot,avgBilledPerCall:qe,prevAvgPerSession:De,prevAvgPerCall:Ke,freshInputTokens:Q,outputTokens:le,skillTokenTotals:Ae}=g.useMemo(()=>{const W=ie.reduce((ve,He)=>ve+He.count,0),_e=ie.reduce((ve,He)=>ve+(He.durationMs??0),0),Be=ie.reduce((ve,He)=>ve+(He.tokens??0),0),ut=y?.totalBilledTokens??0,mt=y?.sessionsCount??0,kt=y?.toolCallsCount??0,yt=mt>0?ut/mt:0,oe=kt>0?ut/kt:0,Ne=H&&H.sessionsCount>0?H.totalBilledTokens/H.sessionsCount:void 0,je=H&&H.toolCallsCount>0?H.totalBilledTokens/H.toolCallsCount:void 0,Ie=Math.max(0,G.totalRead-G.savedTokens),gt=Math.max(0,ut-Ie),Ft=F.reduce((ve,He)=>{for(const[$e,bt]of Object.entries(He.series))ve[$e]=(ve[$e]??0)+bt;return ve},{});return{toolCallTotal:W,toolTimeTotal:_e,toolTokenTotal:Be,avgBilledPerSession:yt,avgBilledPerCall:oe,prevAvgPerSession:Ne,prevAvgPerCall:je,freshInputTokens:Ie,outputTokens:gt,skillTokenTotals:Ft}},[ie,y,H,G,F]);return t?a.jsx("div",{className:"flex items-center justify-center p-16",children:a.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-primary border-t-transparent animate-spin"})}):n?a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error",children:a.jsxs("span",{children:["Failed to load history summary: ",n]})}):!e||!y?null:a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx($o,{label:"Total Billed Tokens",value:Ce(y.totalBilledTokens),sub:`Fresh ${Ce(Q)} · Output ${Ce(le)}`,trend:Z.billed,trendColor:"#3987e5",current:y.totalBilledTokens,previous:H?.totalBilledTokens}),a.jsx($o,{label:"Cache-Saved Tokens",value:Ce(y.cacheSavedTokens),sub:`Share ${Wn(y.cacheSavedPercent)} · Hit ${Wn(G.hitRatio)}`,trend:Z.cacheSaved,trendColor:"#22d3ee",current:y.cacheSavedTokens,previous:H?.cacheSavedTokens,badge:a.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-bold bg-emerald-500/20 text-emerald-400 border border-emerald-500/30",children:[y.cacheSavedPercent,"% saved"]})}),a.jsx($o,{label:"Sessions",value:Ct(y.sessionsCount),sub:`${Ct(y.sessionsCount>0?y.toolCallsCount/y.sessionsCount:0)} calls / session`,trend:Z.sessions,trendColor:"#9085e9",current:y.sessionsCount,previous:H?.sessionsCount}),a.jsx($o,{label:"Tool Calls",value:Ct(y.toolCallsCount),sub:`${Ce(qe)} billed / step`,trend:Z.toolCalls,trendColor:"#c98500",current:y.toolCallsCount,previous:H?.toolCallsCount,badge:a.jsxs("span",{className:"px-2 py-0.5 rounded-full text-xs font-mono bg-amber-500/20 text-amber-400 border border-amber-500/30",children:[Wn(y.errorRate)," err"]})})]}),a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"flex flex-wrap justify-between items-center gap-3",children:[a.jsx("div",{children:a.jsx("h3",{className:"font-bold text-base text-base-content",children:a.jsx(Br,{tip:"4-block breakdown across Model, Source, Tool, and Skill (Stacked token bars with Cache Hit % and Gain Ratio % line overlays)",position:"bottom",className:"cursor-help [&:before]:whitespace-normal [&:before]:max-w-xs [&:before]:text-left [&:before]:text-[11px] [&:before]:font-normal [&:before]:leading-snug z-20","data-testid":"summary-overview-tooltip",children:a.jsx("span",{className:"hover:text-primary transition-colors",children:"Token Activity & Cache Hit Ratio & Gain Ratio"})})})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("fieldset",{className:"flex items-center bg-base-300 p-0.5 rounded-lg text-xs border-0",children:[a.jsx("legend",{className:"sr-only",children:"Bucket interval"}),GG.map(W=>a.jsx("button",{type:"button","aria-pressed":i===W,className:`px-2 py-1 rounded font-medium transition-colors ${i===W?"bg-base-100 text-base-content font-bold shadow-sm":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>o?.(W),children:W},W))]}),a.jsx("div",{className:"flex items-center bg-base-300 p-0.5 rounded-lg text-xs",children:["chart","table"].map(W=>a.jsx("button",{type:"button","aria-pressed":u===W,className:`px-2.5 py-1 rounded font-medium transition-colors ${u===W?"bg-base-100 text-base-content font-bold shadow-sm":"text-base-content/60 hover:bg-base-content/10"}`,onClick:()=>{c(W),p({model:W,source:W,tool:W,skill:W})},children:W==="chart"?"All Charts":"All Tables"},W))})]})]}),a.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[a.jsx(zo,{title:"By Model",description:"Token load by LLM model with cache hit ratio and gain ratio overlays",series:te,buckets:ye,chartMode:d.model,onToggleChartMode:f,testId:"summary-block-model"}),a.jsx(zo,{title:"By Source",description:"Token load by agent platform with cache hit ratio and gain ratio overlays",series:O,buckets:we,chartMode:d.source,onToggleChartMode:m,testId:"summary-block-source"}),a.jsx(zo,{title:"By Tool",description:"Token load (or call volume when unmeasured) by tool execution with cache hit ratio and gain ratio overlays",series:he,buckets:Pe,chartMode:d.tool,onToggleChartMode:b,testId:"summary-block-tool"}),a.jsx(zo,{title:"By Skill",description:"Token load by specialized skill with cache hit ratio and gain ratio overlays",series:be,buckets:ue,chartMode:d.skill,onToggleChartMode:x,testId:"summary-block-skill"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Token by Model"}),a.jsx("div",{className:"flex flex-col gap-3",children:A.map(W=>a.jsx(ME,{item:W,maxTotal:w},W.id))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Token by Agent"}),a.jsx("div",{className:"flex flex-col gap-3",children:N.map(W=>a.jsx(ME,{item:W,maxTotal:w},W.id))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Cache Efficiency By Model"}),G.byModel&&G.byModel.length>0&&a.jsx(FE,{items:G.byModel.map(W=>({id:W.model,label:W.modelName,color:W.color,hitRatio:W.hitRatio,savedTokens:W.savedTokens,totalRead:W.totalRead,billedTokens:W.billedTokens}))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Cache Efficiency By Agent"}),(G.bySource&&G.bySource.length>0||N.length>0)&&a.jsx(FE,{items:(G.bySource&&G.bySource.length>0?G.bySource:N.map(W=>({source:W.id,sourceName:W.label,color:W.color,hitRatio:G.hitRatio,savedTokens:Math.round(G.savedTokens*(W.share/100)),totalRead:Math.round(G.totalRead*(W.share/100)),billedTokens:W.tokens}))).map(W=>({id:W.source,label:W.sourceName,color:W.color,hitRatio:W.hitRatio,savedTokens:W.savedTokens,totalRead:W.totalRead,billedTokens:W.billedTokens}))})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Agent × Model Correlation Matrix"}),q.length>0&&re.length>0&&a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{className:"text-left pr-2 py-1 text-base-content/60 sticky left-0 bg-base-200 z-10",children:"Model \\ Agent"}),re.map(W=>a.jsx("th",{className:"px-1 py-1 text-base-content/60 whitespace-nowrap",title:I.get(W)??W,children:I.get(W)??W},W))]})}),a.jsx("tbody",{children:q.map(W=>a.jsxs("tr",{children:[a.jsx("td",{className:"pr-2 py-1 font-bold text-base-content/80 whitespace-nowrap sticky left-0 bg-base-200",children:W}),re.map(_e=>{const Be=pe.get(`${_e}\0${W}`);return a.jsx("td",{className:"p-0.5",children:Be?a.jsxs("div",{className:"h-8 min-w-[3rem] rounded-md flex items-center justify-center text-[10px] font-bold border border-base-content/10 cursor-default",style:{background:`rgba(6, 182, 212, ${.08+.5*(Be.hitRatio/100)})`},title:`${Be.sourceName} × ${Be.modelName}: ${Be.hitRatio}% hit · saved ${Ce(Be.savedTokens)} / read ${Ce(Be.totalRead)} / billed ${Ce(Be.billedTokens)}`,children:[Be.hitRatio,"%"]}):a.jsx("div",{className:"h-8 min-w-[3rem] rounded-md flex items-center justify-center text-[10px] text-base-content/25 bg-base-300/40",children:"—"})},_e)})]},W))})]})}),a.jsxs("div",{className:"flex items-center gap-2 text-[10px] font-mono text-base-content/60",children:[a.jsx("span",{children:"0%"}),a.jsx("div",{className:"h-1.5 w-32 rounded-full bg-gradient-to-r from-base-300 to-cyan-400"}),a.jsx("span",{children:"100% cache hit ratio"})]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5",children:[a.jsx("h4",{className:"font-bold text-sm mb-2",children:"Top Tools & Error Rates"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs text-left font-mono",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{className:"py-1.5",children:"Tool"}),a.jsx("th",{className:"py-1.5 min-w-[120px]",children:"Usage Share"}),a.jsx("th",{className:"py-1.5 min-w-[120px]",children:"Time Share"}),a.jsx("th",{className:"py-1.5 min-w-[120px]",children:"Token Share"}),a.jsx("th",{className:"py-1.5 text-right",children:"Calls"}),a.jsx("th",{className:"py-1.5 text-right",children:"Errors"}),a.jsx("th",{className:"py-1.5 text-right",children:"Error Rate"})]})}),a.jsx("tbody",{children:ie.map(W=>{const _e=W.usageShare??(At>0?Math.round(W.count/At*1e3)/10:0),Be=W.timeShare??(ft>0?Math.round((W.durationMs??0)/ft*1e3)/10:0),ut=W.tokenShare??(dt>0?Math.round((W.tokens??0)/dt*1e3)/10:0);return a.jsxs("tr",{className:"border-b border-base-content/5 hover:bg-base-300/30",children:[a.jsx("td",{className:"py-1.5 font-bold",children:W.id}),a.jsx("td",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16",children:a.jsx(fi,{value:_e,max:100,color:"#3987e5"})}),a.jsx("span",{className:"tabular-nums text-[10px] text-base-content/70",children:Wn(_e)})]})}),a.jsx("td",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16",children:a.jsx(fi,{value:Be,max:100,color:"#10b981"})}),a.jsx("span",{className:"tabular-nums text-[10px] text-base-content/70",children:Be>0?Wn(Be):"—"})]})}),a.jsx("td",{className:"py-1.5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-16",children:a.jsx(fi,{value:ut,max:100,color:"#f59e0b"})}),a.jsx("span",{className:"tabular-nums text-[10px] text-base-content/70",children:ut>0?Wn(ut):"—"})]})}),a.jsx("td",{className:"py-1.5 text-right tabular-nums",children:Ct(W.count)}),a.jsx("td",{className:"py-1.5 text-right tabular-nums",children:W.errors>0?Ct(W.errors):"0"}),a.jsx("td",{className:"py-1.5 text-right",children:a.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] ${W.errorRate>1?"bg-error/20 text-error font-bold":"bg-base-300 text-base-content/70"}`,children:Wn(W.errorRate)})})]},W.id)})})]})})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col gap-4",children:[a.jsx("h4",{className:"font-bold text-sm mb-3",children:"Efficiency Stats & Skills"}),a.jsx("div",{children:a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-xs font-mono",children:[a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"text-base-content/60 text-[10px] uppercase tracking-wider",children:"Avg Billed / Session"}),a.jsx("span",{className:"font-bold",children:Ce(Ot)}),a.jsx(Vd,{current:Ot,previous:De,invert:!0})]}),a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"text-base-content/60 text-[10px] uppercase tracking-wider",children:"Avg Billed / Step"}),a.jsx("span",{className:"font-bold",children:Ce(qe)}),a.jsx(Vd,{current:qe,previous:Ke,invert:!0})]}),a.jsxs("div",{className:"flex flex-col gap-0.5",children:[a.jsx("span",{className:"text-base-content/60 text-[10px] uppercase tracking-wider",children:"Loop Detection Findings"}),a.jsxs("span",{className:"font-bold",children:[Ct(l?.redundantCalls??0)," redundant"]}),a.jsxs("span",{className:"text-[10px] text-base-content/60",children:[Ce(l?.wastedTokens??0)," wasted"]})]})]})}),k.length>0&&a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2",children:"Skills Invocation Mix"}),a.jsx(RE,{buckets:Ye,series:qG(k),height:150}),a.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:k.map(W=>a.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-full bg-base-300 border border-base-content/10 gap-1.5 font-mono text-[11px]",children:[a.jsx("span",{className:"w-2 h-2 rounded-full",style:{background:W.color}}),a.jsxs("span",{children:[W.label,":"]}),a.jsxs("span",{className:"font-bold",children:[Ce(Ae[W.id]??0)," tokens"]})]},W.id))})]})]})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 p-5 flex flex-col gap-4","data-testid":"summary-skill-breakdown",children:[a.jsx("div",{children:a.jsx("h4",{className:"font-bold text-sm",children:a.jsx(Br,{tip:"Skill invocations by name, agent, and invocation kind over the selected window.",position:"top",className:"cursor-help [&:before]:whitespace-normal [&:before]:max-w-xs [&:before]:text-left [&:before]:text-[11px] [&:before]:font-normal [&:before]:leading-snug z-20","data-testid":"summary-skill-breakdown-tooltip",children:a.jsx("span",{className:"hover:text-primary transition-colors",children:"Skill Load Breakdown"})})})}),C.fresh===!1?a.jsx("div",{className:"flex flex-col items-center justify-center text-[11px] text-base-content/40 font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30 py-6",children:a.jsx("span",{children:"Skill rollup not yet built — run history analyze to populate this section."})}):C.bySkill.length>0?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-xs font-mono",children:[a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"Top Skills"}),a.jsx("div",{className:"flex flex-col gap-1.5",children:C.bySkill.map((W,_e)=>a.jsxs("div",{className:"flex justify-between items-center gap-2",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2 h-2 rounded-full shrink-0",style:{background:Yr[_e%Yr.length]??"#3987e5"}}),W.skillName]}),a.jsx("span",{className:"font-bold tabular-nums",children:Ct(W.calls)})]},W.skillName))})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"By Agent"}),a.jsx("div",{className:"flex flex-col gap-1.5",children:C.bySource.map(W=>a.jsxs("div",{className:"flex justify-between items-center gap-2",children:[a.jsx("span",{children:W.source}),a.jsx("span",{className:"font-bold tabular-nums",children:Ct(W.calls)})]},W.source))})]}),a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"By Invocation Kind"}),a.jsx("div",{className:"flex flex-col gap-1.5",children:C.byInvocationKind.map(W=>a.jsxs("div",{className:"flex justify-between items-center gap-2",children:[a.jsx("span",{className:"capitalize",children:W.invocationKind}),a.jsx("span",{className:"font-bold tabular-nums",children:Ct(W.calls)})]},W.invocationKind))})]})]}),at.length>0&&a.jsxs("div",{children:[a.jsx("h5",{className:"font-bold text-xs mb-2 text-base-content/60",children:"Skill Call Trend"}),a.jsx(RE,{buckets:at,series:Qe,height:150})]})]}):a.jsx("div",{className:"flex flex-col items-center justify-center text-[11px] text-base-content/40 font-mono border border-dashed border-base-content/10 rounded-xl bg-base-100/30 py-6",children:a.jsx("span",{children:"No skill activity recorded for this window."})})]})]})}),qG=e=>e.map(t=>({id:t.id,label:t.label,color:t.color})),ME=g.memo(({item:e,maxTotal:t})=>{const n=e.freshInputTokens??(e.outputTokens?e.tokens-e.outputTokens:e.tokens),r=e.cacheReadTokens??0,s=e.outputTokens??0,i=t>0?t:1,o=l=>`${Math.round(l/i*1e3)/10}%`;return a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsxs("div",{className:"flex justify-between text-xs font-mono",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{background:e.color}}),e.label]}),a.jsx("span",{children:Ce(e.tokens)})]}),a.jsxs("div",{className:"w-full bg-base-300 h-3 rounded-full overflow-hidden flex",children:[n>0&&a.jsx("div",{className:"h-full",style:{width:o(n),background:"#3987e5"}}),s>0&&a.jsx("div",{className:"h-full",style:{width:o(s),background:"#f59e0b"}})]}),a.jsxs("div",{className:"flex justify-between text-[10px] text-base-content/60 font-mono",children:[a.jsxs("span",{children:["Fresh ",Ce(n)," · Cached ",Ce(r)," · Output ",Ce(s)]}),a.jsxs("span",{children:["Total ",Ce(n+r+s)]})]})]})}),FE=g.memo(({items:e})=>a.jsx("div",{className:"flex flex-col gap-2",children:e.map(t=>a.jsxs("div",{className:"flex flex-col gap-1 bg-base-300/40 p-2.5 rounded-lg border border-base-content/5",children:[a.jsxs("div",{className:"flex justify-between items-center text-xs",children:[a.jsxs("span",{className:"flex items-center gap-1.5 font-medium",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full",style:{background:t.color}}),t.label]}),a.jsxs("span",{className:"font-mono font-bold text-cyan-400",children:[t.hitRatio,"%"]})]}),a.jsx("div",{className:"w-full bg-base-100 h-1.5 rounded-full overflow-hidden",children:a.jsx("div",{className:"h-full rounded-full",style:{width:`${t.hitRatio}%`,background:t.color}})}),a.jsxs("div",{className:"flex justify-between text-[10px] text-base-content/60 font-mono",children:[a.jsxs("span",{children:["Saved: ",Ce(t.savedTokens)]}),a.jsxs("span",{children:["Total Read: ",Ce(t.totalRead)," · Billed: ",Ce(t.billedTokens)]})]})]},t.id))})),VG=({blocks:e,start:t,end:n,onJumpToTime:r})=>{const s=g.useId(),{bins:i,maxBinTokens:o,maxBinOperations:l,startMs:u,endMs:c,hasValidRange:d}=g.useMemo(()=>{if(!t||!n||e.length===0)return{bins:[],maxBinTokens:0,maxBinOperations:0,startMs:0,endMs:0,hasValidRange:!1};const p=Date.parse(t),f=Date.parse(n);if(Number.isNaN(p)||Number.isNaN(f)||f<p)return{bins:[],maxBinTokens:0,maxBinOperations:0,startMs:0,endMs:0,hasValidRange:!1};const m=96,x=Math.max(1,f-p)/m,y=Array.from({length:m},(S,A)=>({index:A,timeMs:p+A*x,tokens:0,operations:0}));for(const S of e){if(!S.timestamp)continue;const A=Date.parse(S.timestamp);if(Number.isNaN(A)||A<p||A>f)continue;const N=Math.min(m-1,Math.max(0,Math.floor((A-p)/x))),T=y[N];T&&(T.tokens+=S.totalTokens,T.operations+=S.operationCount)}const E=Math.max(1,...y.map(S=>S.tokens)),v=Math.max(1,...y.map(S=>S.operations));return{bins:y,maxBinTokens:E,maxBinOperations:v,startMs:p,endMs:f,hasValidRange:!0}},[e,t,n]);return!d||i.length===0?null:a.jsxs("div",{"data-testid":"timeline-scrubber",className:"flex flex-col gap-1.5 p-3 bg-base-200/80 rounded-xl border border-base-content/10 font-mono text-xs",children:[a.jsxs("div",{className:"flex items-center justify-between text-[11px] text-base-content/60 px-1",children:[a.jsxs("span",{children:["Timeline Activity (",i.length," bins)"]}),a.jsxs("span",{children:["Peak: ",Ce(o)]})]}),a.jsx("div",{className:"relative h-10 w-full bg-base-300/60 rounded-lg overflow-hidden flex items-end p-1",children:a.jsx("svg",{viewBox:"0 0 96 32",preserveAspectRatio:"none",className:"w-full h-full text-primary/70","aria-hidden":"true",children:i.map(p=>{const f=p.operations>0?Math.max(2,Math.round(p.operations/l*30)):0,m=p.tokens>0?.35+p.tokens/o*.65:.25,b=32-f;return a.jsx("rect",{x:p.index,y:b,width:"0.85",height:f,fill:"currentColor",fillOpacity:m,"data-operations":p.operations,"data-tokens":p.tokens,className:"hover:text-cyan-400 transition-colors",children:a.jsx("title",{children:`${new Date(p.timeMs).toISOString()} · ${Ce(p.tokens)} · ${p.operations} ops`})},p.index)})})}),a.jsx("label",{htmlFor:s,className:"sr-only",children:"Timeline scrub slider"}),a.jsx("input",{id:s,type:"range",min:u,max:c,defaultValue:u,"aria-label":"Timeline navigation scrubber","data-testid":"timeline-scrubber-range",className:"w-full range range-xs range-primary cursor-pointer accent-primary",onInput:p=>{const f=Number(p.currentTarget.value);Number.isFinite(f)&&r?.(new Date(f).toISOString())}})]})},Cs=(e,t)=>`${e}:${t}`,Is=(e,t)=>JSON.stringify([e,t]),Kr=e=>e.replace(/[^a-zA-Z0-9_-]/g,"-"),Ll=(e,t,n)=>e+t+n,YG=(e,t)=>{const n=e+t;return n>0?t/n*100:0},Yd=e=>e.length<=12?e:`${e.slice(0,8)}…${e.slice(-4)}`,KG=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],vv=e=>{if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=KG[t.getUTCMonth()],r=t.getUTCDate(),s=String(t.getUTCHours()).padStart(2,"0"),i=String(t.getUTCMinutes()).padStart(2,"0");return`${n} ${r} ${s}:${i}`},Kd=e=>{if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return e.slice(11,19)||e;const n=String(t.getUTCHours()).padStart(2,"0"),r=String(t.getUTCMinutes()).padStart(2,"0"),s=String(t.getUTCSeconds()).padStart(2,"0");return`${n}:${r}:${s}`},PE=e=>`${Yd(e.id)} · ${e.source} · ${vv(e.start)} · ${Ce(e.tokenLoad)}`,ZG=e=>{const t=e.payload?.trim();return t&&t.length>0?t:e.title},BE=e=>e.split(/\r?\n/).map(n=>n.trim()).find(n=>n.length>0)??e,UE=e=>e.kind==="assistant"||e.eventType==="message"&&e.kind!=="user",XG=e=>{const t=(e.toolName||e.kind||"").toLowerCase();return t.includes("glob")?{label:e.toolName||"glob",color:"#6366f1"}:t.includes("grep")?{label:e.toolName||"grep",color:"#a855f7"}:t.includes("edit")||t.includes("write")||t.includes("patch")?{label:e.toolName||"edit",color:"#eab308"}:t.includes("read")||t.includes("view")||t.includes("list")?{label:e.toolName||"read",color:"#10b981"}:t.includes("bash")||t.includes("exec")||t.includes("command")||t.includes("terminal")?{label:e.toolName||"bash",color:"#3b82f6"}:t.includes("search")||t.includes("find")?{label:e.toolName||"search",color:"#a855f7"}:t.includes("run")?{label:e.toolName||"run",color:"#f59e0b"}:{label:e.toolName||e.kind,color:"#64748b"}},QG=()=>a.jsxs("svg",{width:14,height:14,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",role:"img","aria-label":"User icon",children:[a.jsx("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),a.jsx("circle",{cx:"12",cy:"7",r:"4"})]}),JG=({promptTokens:e,fullText:t,tooltipId:n})=>{const[r,s]=g.useState(!1),i=e?.freshInputTokens??0,o=e?.cacheReadTokens??0,l=e?.outputTokens??0,u=Ll(i,o,l),c=t.length>0?t.split(/\r?\n/).length:0,d=t.length;return a.jsxs("div",{className:"relative inline-flex items-center z-20",children:[a.jsx("button",{type:"button","aria-label":"Show user prompt token breakdown","aria-describedby":n,"data-testid":`timeline-user-badge-${n}`,className:"p-1 rounded bg-base-300 text-cyan-400 shrink-0 hover:bg-base-content/10 focus:outline-none focus-visible:ring-1 focus-visible:ring-primary transition-colors cursor-pointer",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>s(!0),onBlur:()=>s(!1),onKeyDown:p=>{p.key==="Escape"&&s(!1)},children:a.jsx(QG,{})}),a.jsxs("div",{id:n,role:"tooltip","data-testid":n,className:`absolute left-0 top-full z-50 mt-1.5 w-56 p-2 rounded-lg bg-base-300 border border-base-content/20 shadow-2xl text-[11px] font-mono leading-relaxed pointer-events-none ${r?"block":"hidden"}`,children:[a.jsx("div",{className:"font-bold text-base-content mb-1",children:"User Prompt Telemetry"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80",children:[a.jsx("span",{className:"text-base-content/60",children:"Lines / chars:"}),a.jsxs("span",{children:[c," lines (",d," chars)"]}),a.jsx("span",{className:"text-base-content/60",children:"📥 Fresh input:"}),a.jsx("span",{children:Ce(i)}),a.jsx("span",{className:"text-base-content/60",children:"💾 Cache read:"}),a.jsx("span",{className:"text-cyan-400",children:Ce(o)}),a.jsx("span",{className:"text-base-content/60",children:"📤 Output:"}),a.jsx("span",{children:Ce(l)}),a.jsx("span",{className:"text-base-content/60 border-t border-base-content/10 pt-0.5",children:"⚡ Turn load:"}),a.jsx("span",{className:"font-bold border-t border-base-content/10 pt-0.5 text-primary",children:Ce(u)})]})]})]})},$E=({agentId:e,model:t,timestamp:n,tooltipId:r,freshInputTokens:s=0,cacheReadTokens:i=0,outputTokens:o=0,sessionId:l})=>{const[u,c]=g.useState(!1),d=Ll(s,i,o);return a.jsxs("div",{className:"relative inline-flex items-center z-20",children:[a.jsx("button",{type:"button","aria-label":`Show ${e} metadata and token breakdown`,"aria-describedby":r,"data-testid":`timeline-agent-badge-${r}`,className:"inline-flex items-center justify-center p-1 rounded hover:bg-base-content/10 text-base-content focus:outline-none focus-visible:ring-1 focus-visible:ring-primary transition-colors cursor-pointer",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),onKeyDown:p=>{p.key==="Escape"&&c(!1)},children:a.jsx(or,{id:e})}),a.jsxs("div",{id:r,role:"tooltip","data-testid":r,className:`absolute left-0 top-full z-50 mt-1.5 w-60 p-2.5 rounded-xl bg-base-300 border border-base-content/20 shadow-2xl text-[11px] font-mono leading-relaxed pointer-events-none ${u?"block":"hidden"}`,children:[a.jsxs("div",{className:"font-bold text-base-content mb-1.5 flex items-center gap-1.5 border-b border-base-content/10 pb-1",children:[a.jsx(or,{id:e}),a.jsx("span",{className:"uppercase",children:e}),a.jsxs("span",{className:"text-base-content/50 font-normal truncate",children:["(",t,")"]})]}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80 text-[10.5px]",children:[a.jsx("span",{className:"text-base-content/60",children:"Timestamp:"}),a.jsx("span",{className:"truncate",children:Kd(n)}),l&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-base-content/60",children:"Session:"}),a.jsx("span",{className:"truncate font-bold text-primary",children:l})]})]}),a.jsxs("div",{className:"mt-1.5 pt-1.5 border-t border-base-content/10",children:[a.jsx("div",{className:"font-bold text-base-content/70 text-[10px] uppercase tracking-wider mb-0.5",children:"Token Breakdown"}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-0.5 text-base-content/80 text-[10.5px]",children:[a.jsx("span",{className:"text-base-content/60",children:"📥 Fresh input:"}),a.jsx("span",{children:Ce(s)}),a.jsx("span",{className:"text-base-content/60",children:"💾 Cache read:"}),a.jsx("span",{className:"text-cyan-400",children:Ce(i)}),a.jsx("span",{className:"text-base-content/60",children:"📤 Output:"}),a.jsx("span",{children:Ce(o)}),a.jsx("span",{className:"text-base-content/60 border-t border-base-content/10 pt-0.5",children:"⚡ Total:"}),a.jsx("span",{className:"font-bold border-t border-base-content/10 pt-0.5 text-primary",children:Ce(d)})]})]})]})]})},Av=({data:e,loading:t,error:n,mode:r="session",sessionId:s,availableSessions:i=[],onSelectSession:o,onModeChange:l,consolidatedTaskWbs:u="",consolidatedRunId:c="",onConsolidatedScopeSubmit:d})=>{const p=e?.scope.sessionId,f=e?.scope.source,[m,b]=g.useState({}),[x,y]=g.useState(!0),[E,v]=g.useState(!0),[S,A]=g.useState(!0),[N,T]=g.useState(u),[w,k]=g.useState(c),F=p&&f?Is(f,p):"consolidated",C=m[F]||{},$=Y=>{b(me=>({...me,[F]:Y(me[F]||{})}))},z=(Y,me)=>{const te=Cs(Y,me);$(O=>({...O,[te]:!O[te]}))};if(t)return a.jsx("div",{className:"flex items-center justify-center p-16",children:a.jsx("div",{className:"w-8 h-8 rounded-full border-4 border-primary border-t-transparent animate-spin motion-reduce:animate-none"})});if(n)return a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error",children:a.jsxs("span",{children:["Failed to load timeline: ",n]})});if(!e)return a.jsx("div",{className:"p-4 rounded-lg bg-info/10 border border-info/20 text-info",children:a.jsx("span",{children:"No timeline data available."})});const{scope:M,blocks:G,truncated:H}=e,j=Ll(M.tokens.freshInputTokens,M.tokens.cacheReadTokens,M.tokens.outputTokens),q=YG(M.tokens.freshInputTokens,M.tokens.cacheReadTokens),re=G.map(Y=>{const me=Y.events.filter(te=>UE(te)?!x:te.kind==="unknown"||te.agent==="unknown"?!E:!(S&&!te.payload?.trim()&&(te.durationMs===null||te.durationMs===0)&&Ll(te.freshInputTokens,te.cacheReadTokens,te.outputTokens)===0));return{...Y,events:me}}).filter(Y=>Y.events.length>0),pe=re.flatMap(Y=>Y.events.filter(me=>!!me.payload?.trim()).map(me=>Cs(Y.key,me.seq))),I=pe.length>0&&pe.every(Y=>C[Y]),Z=()=>$(()=>I?{}:Object.fromEntries(pe.map(Y=>[Y,!0]))),ie=i.findIndex(Y=>Y.id===M.sessionId&&Y.source===M.source),L=ie>0?i[ie-1]:void 0,Ee=ie>=0&&ie<i.length-1?i[ie+1]:void 0,fe=Y=>{const me=Date.parse(Y),te=re.find(O=>{const he=O.timestamp?Date.parse(O.timestamp):Number.NaN;return Number.isFinite(he)&&he>=me})??re.at(-1);te&&document.getElementById(`timeline-block-${Kr(te.key)}`)?.scrollIntoView({behavior:"smooth",block:"center"})};return a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-5 flex flex-col gap-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsx("h3",{className:"text-base font-bold tracking-tight",children:"Conversation"}),a.jsxs("fieldset",{className:"inline-flex border border-base-content/20 rounded-lg p-0.5 bg-base-300 font-mono text-xs",children:[a.jsx("legend",{className:"sr-only",children:"Timeline mode"}),a.jsx("button",{type:"button","data-testid":"timeline-mode-session","aria-pressed":r==="session",className:`px-3 py-1 font-bold rounded-md transition-all cursor-pointer ${r==="session"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content"}`,onClick:()=>l?.("session"),children:"Single Session"}),a.jsx("button",{type:"button","data-testid":"timeline-mode-consolidated","aria-pressed":r==="consolidated",className:`px-3 py-1 font-bold rounded-md transition-all cursor-pointer ${r==="consolidated"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content"}`,onClick:()=>l?.("consolidated"),children:"Consolidated"})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[r==="session"?a.jsxs(a.Fragment,{children:[a.jsxs("label",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"sr-only",children:"Session"}),a.jsx("select",{"aria-label":"Select Session","data-testid":"timeline-session-select",className:"px-3 py-1.5 min-h-[44px] text-xs rounded-lg border border-base-content/20 bg-base-300 font-mono text-base-content max-w-xs focus:outline-hidden focus:border-primary cursor-pointer",value:M.source&&M.sessionId?Is(M.source,M.sessionId):"",onChange:Y=>{const me=i.find(te=>Is(te.source,te.id)===Y.target.value);me&&o?.(me.source,me.id)},children:i.length>0?i.map(Y=>a.jsx("option",{value:Is(Y.source,Y.id),children:PE(Y)},Is(Y.source,Y.id))):a.jsx("option",{value:M.source&&M.sessionId?Is(M.source,M.sessionId):"",children:M.sessionId?PE({id:M.sessionId,source:M.source??"unknown",start:M.start??"",tokenLoad:j}):"No session selected"})})]}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("button",{type:"button","aria-label":"Previous session",disabled:!L,className:"px-3 py-2 min-h-[44px] min-w-[44px] inline-flex items-center justify-center text-xs font-mono rounded-lg border border-base-content/20 bg-base-300 text-base-content/80 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-base-content/10 transition-colors focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",onClick:()=>L&&o?.(L.source,L.id),children:"←"}),a.jsx("button",{type:"button","aria-label":"Next session",disabled:!Ee,className:"px-3 py-2 min-h-[44px] min-w-[44px] inline-flex items-center justify-center text-xs font-mono rounded-lg border border-base-content/20 bg-base-300 text-base-content/80 disabled:opacity-40 disabled:cursor-not-allowed hover:bg-base-content/10 transition-colors focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",onClick:()=>Ee&&o?.(Ee.source,Ee.id),children:"→"})]})]}):a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg bg-base-300 border border-base-content/20 text-xs font-mono",children:[a.jsx("span",{className:"text-base-content/60",children:"Scope:"}),a.jsxs("span",{className:"font-semibold text-primary",children:[M.sessionCount," sessions"]})]}),a.jsxs("form",{className:"flex flex-wrap items-end gap-2",onSubmit:Y=>{Y.preventDefault(),d?.({taskWbs:N.trim(),runId:w.trim()})},children:[a.jsxs("label",{className:"flex flex-col gap-1 text-[10px] font-mono text-base-content/60",children:["Task WBS",a.jsx("input",{type:"text",value:N,onInput:Y=>T(Y.currentTarget.value),className:"min-h-[44px] w-28 rounded-lg border border-base-content/20 bg-base-300 px-2 text-xs text-base-content focus:outline-hidden focus:border-primary"})]}),a.jsxs("label",{className:"flex flex-col gap-1 text-[10px] font-mono text-base-content/60",children:["Run ID",a.jsx("input",{type:"text",value:w,onInput:Y=>k(Y.currentTarget.value),className:"min-h-[44px] w-40 rounded-lg border border-base-content/20 bg-base-300 px-2 text-xs text-base-content focus:outline-hidden focus:border-primary"})]}),a.jsx("button",{type:"submit",className:"min-h-[44px] rounded-lg bg-primary px-3 text-xs font-semibold text-primary-content focus-visible:ring-2 focus-visible:ring-primary cursor-pointer hover:bg-primary/90 transition-colors",children:"Apply scope"})]})]}),a.jsx("button",{type:"button","aria-pressed":I,disabled:pe.length===0,className:"px-3.5 py-2 min-h-[44px] rounded-lg text-xs font-semibold border border-primary/30 text-primary hover:bg-primary/10 disabled:opacity-40 disabled:cursor-not-allowed transition-colors focus-visible:ring-2 focus-visible:ring-primary cursor-pointer",onClick:Z,children:I?"Collapse all":"Expand all"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs font-mono text-base-content/80",children:[a.jsxs("label",{className:"inline-flex items-center gap-1.5 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox","data-testid":"timeline-filter-assistant",className:"w-3.5 h-3.5 rounded border border-base-content/30 accent-primary focus-visible:ring-1 focus-visible:ring-primary",checked:x,onChange:Y=>y(Y.target.checked)}),a.jsx("span",{children:"Hide assistant"})]}),a.jsxs("label",{className:"inline-flex items-center gap-1.5 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox","data-testid":"timeline-filter-unknown",className:"w-3.5 h-3.5 rounded border border-base-content/30 accent-primary focus-visible:ring-1 focus-visible:ring-primary",checked:E,onChange:Y=>v(Y.target.checked)}),a.jsx("span",{children:"Hide unknown"})]}),a.jsxs("label",{className:"inline-flex items-center gap-1.5 cursor-pointer select-none",children:[a.jsx("input",{type:"checkbox","data-testid":"timeline-filter-empty",className:"w-3.5 h-3.5 rounded border border-base-content/30 accent-primary focus-visible:ring-1 focus-visible:ring-primary",checked:S,onChange:Y=>A(Y.target.checked)}),a.jsx("span",{children:"Hide other empty"})]})]})]})]}),a.jsxs("div",{"data-testid":"timeline-metadata-strip",className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-5 lg:grid-cols-9 gap-3 pt-3 border-t border-base-content/10 text-xs font-mono",children:[a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:r==="session"?"SESSION":"SESSIONS"}),a.jsx("span",{className:"font-semibold truncate text-base-content mt-0.5",title:M.sessionId??`${M.sessionCount} sessions`,children:M.sessionId?Yd(M.sessionId):`${M.sessionCount} total`})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"AGENT"}),a.jsx("span",{className:"inline-flex items-center gap-1 font-semibold truncate text-base-content mt-0.5",children:M.source?a.jsxs(a.Fragment,{children:[a.jsx(or,{id:M.source}),M.source]}):"multiple"})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"MODEL"}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate text-base-content mt-0.5",children:[a.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary/70 shrink-0"}),M.model??"multiple"]})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"STARTED"}),a.jsx("span",{className:"truncate text-base-content/80 mt-0.5",children:vv(M.start)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"DURATION"}),a.jsx("span",{className:"font-semibold truncate text-base-content mt-0.5",children:fv(M.durationMs/6e4)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"TOTAL TOKENS"}),a.jsx("span",{className:"font-bold text-primary truncate mt-0.5",children:Ce(j)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"CACHE READ"}),a.jsxs("span",{className:"font-semibold text-cyan-400 truncate mt-0.5",children:[q.toFixed(1),"%"]})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"OUTPUT TOKENS"}),a.jsx("span",{className:"truncate text-base-content/80 mt-0.5",children:Ce(M.tokens.outputTokens)})]}),a.jsxs("div",{className:"flex flex-col bg-base-300/40 p-2 rounded-lg border border-base-content/5",children:[a.jsx("span",{className:"text-[10px] uppercase tracking-wider text-base-content/60",children:"TOOL CALLS"}),a.jsx("span",{className:"truncate text-base-content font-bold mt-0.5",children:Ct(M.toolCallCount)})]})]}),a.jsx(VG,{blocks:re,start:M.start,end:M.end,onJumpToTime:fe})]}),H&&a.jsxs("div",{"data-testid":"timeline-truncated-banner",className:"p-3 rounded-lg bg-info/10 border border-info/20 text-info font-mono text-xs flex items-center gap-2",children:[a.jsx("span",{children:"ℹ️"}),a.jsx("span",{children:"Showing newest 5,000 events. Apply a narrower filter or time window to inspect earlier events."})]}),a.jsx("div",{"data-testid":"timeline-rail",className:"relative py-2 sm:py-4 before:absolute before:left-2 sm:before:left-[136px] before:top-0 before:bottom-0 before:w-[2px] before:bg-base-content/20 flex flex-col gap-3",children:re.map(Y=>{const me=Y.events.filter(O=>O.kind==="user"),te=Y.events.filter(O=>O.kind!=="user");return a.jsxs("div",{id:`timeline-block-${Kr(Y.key)}`,"data-testid":`timeline-block-${Y.key}`,className:"flex flex-col gap-2.5",children:[r==="consolidated"&&a.jsxs("div",{className:"flex items-center gap-2 pl-6 sm:pl-[144px] pt-2 pb-1 font-mono text-xs text-base-content/70",children:[a.jsx(or,{id:Y.source}),a.jsx("span",{className:"font-bold text-base-content",children:Y.source}),a.jsxs("span",{children:["· ",Yd(Y.sessionId)]}),a.jsxs("span",{children:["· Turn #",Y.turnIndex]}),Y.correlationExactness&&a.jsx("span",{"data-testid":`timeline-exactness-${Y.key}`,className:`px-1.5 py-0.2 rounded text-[10px] font-bold ${Y.correlationExactness==="exact"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-amber-500/10 text-amber-400 border border-amber-500/20"}`,children:Y.correlationExactness})]}),me.map(O=>{const he=ZG(O),be=O.payload?.trim()??"",ye=BE(he),we=!!O.payload?.trim(),Pe=!!C[Cs(Y.key,O.seq)],ue=Kr(`timeline-user-drawer-${Y.key}-${O.seq}`),Ye=Kr(`user-tt-${Y.key}-${O.seq}`);return a.jsxs("div",{className:"relative flex flex-col sm:grid sm:grid-cols-[136px_minmax(0,1fr)] py-1","data-testid":`timeline-user-event-${Y.key}-${O.seq}`,children:[a.jsxs("div",{className:"hidden sm:flex flex-col items-end justify-center pr-4 font-mono text-[10.5px] text-base-content/80 select-none",title:Y.timestamp?`Timestamp: ${Kd(Y.timestamp)}`:void 0,children:[a.jsxs("span",{className:"font-semibold text-primary truncate",children:["📥 ",Ce(O.freshInputTokens)," in"]}),O.durationSource==="measured"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,className:O.durationMs>=5e3?"font-bold text-amber-400":"text-base-content/60",children:["⏱ ",Hs(O.durationMs)]}):O.durationSource==="inferred"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Inferred from next event timestamp within session",className:"text-base-content/60 italic",children:["⏱ ~",Hs(O.durationMs)]}):a.jsx("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Unmeasured (gap > 10m or last event)",className:"text-base-content/40",children:"⏱ —"})]}),a.jsx("span",{"data-timeline-node":"prompt",className:"absolute left-[3.5px] sm:left-[131.5px] top-1/2 -translate-y-1/2 w-[9px] h-[9px] rounded-full bg-cyan-400 ring-4 ring-base-100 z-10","aria-hidden":"true"}),a.jsx("div",{className:"pl-6 sm:pl-5 min-w-0 flex justify-end",children:a.jsxs("div",{className:"w-[80%] max-w-none bg-base-100 rounded-xl border border-primary/20 hover:border-primary/40 hover:bg-base-200/40 transition-all p-2.5 sm:px-3.5 sm:py-2.5 flex flex-col gap-1 shadow-xs relative",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 min-h-[32px]",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:"relative z-10",children:a.jsx(JG,{promptTokens:O.promptTokens,fullText:be,tooltipId:Ye})}),a.jsx("span",{className:"font-mono text-xs font-semibold text-base-content/90 truncate min-w-0",children:ye})]}),a.jsx("div",{className:"flex items-center gap-2 shrink-0 font-mono text-[11px] text-base-content/60",children:we?a.jsx("button",{type:"button","aria-label":Pe?"Collapse full user prompt":"Expand full user prompt","aria-expanded":Pe,"aria-controls":ue,onClick:()=>z(Y.key,O.seq),className:"p-1 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 inline-flex items-center justify-center text-base-content/60 hover:text-base-content transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary rounded after:absolute after:inset-0 after:rounded-xl after:content-['']",children:a.jsx("span",{className:`text-xs font-mono transition-transform duration-150 ${Pe?"rotate-90":""}`,"aria-hidden":"true",children:"›"})}):null})]}),Pe&&we&&a.jsx("div",{id:ue,className:"mt-1 p-3 bg-[#0d141f] text-slate-100 rounded-md font-mono text-xs whitespace-pre-wrap overflow-x-auto border border-white/10 relative z-10",children:Gc(he)})]})})]},Cs(Y.key,O.seq))}),te.map(O=>{const he=XG(O),be=!!C[Cs(Y.key,O.seq)],ye=!!O.payload?.trim(),we=Kr(`timeline-op-drawer-${Y.key}-${O.seq}`),Pe=Kr(`agent-tt-${Y.key}-${O.seq}`),ue=Kr(`tool-tt-${Y.key}-${O.seq}`),Ye=UE(O);return a.jsxs("div",{className:"relative flex flex-col sm:grid sm:grid-cols-[136px_minmax(0,1fr)] py-1 hover:z-30 focus-within:z-30","data-testid":`timeline-op-event-${Y.key}-${O.seq}`,children:[a.jsxs("div",{className:"hidden sm:flex flex-col items-end justify-center pr-4 font-mono text-[10.5px] text-base-content/80 select-none",title:Y.timestamp?`Timestamp: ${Kd(Y.timestamp)}`:void 0,children:[a.jsx("span",{className:"font-semibold text-base-content/90 truncate",children:Ye&&O.outputTokens>0?`📤 ${Ce(O.outputTokens)} out`:`⚡ ${Ce(O.tokens)} tok`}),O.durationSource==="measured"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,className:O.durationMs>=5e3?"font-bold text-amber-400":"text-base-content/60",children:["⏱ ",Hs(O.durationMs)]}):O.durationSource==="inferred"&&O.durationMs!==null?a.jsxs("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Inferred from next event timestamp within session",className:"text-base-content/60 italic",children:["⏱ ~",Hs(O.durationMs)]}):a.jsx("span",{"data-testid":`timeline-step-duration-${Y.key}-${O.seq}`,title:"Unmeasured (gap > 10m or last event)",className:"text-base-content/40",children:"⏱ —"})]}),a.jsx("span",{"data-timeline-node":"operation",className:"absolute left-[3.5px] sm:left-[131.5px] top-1/2 -translate-y-1/2 w-[9px] h-[9px] rounded-full ring-4 ring-base-100 z-10",style:{backgroundColor:he.color},"aria-hidden":"true"}),a.jsx("div",{className:"pl-6 sm:pl-5 min-w-0 flex justify-start",children:Ye?a.jsxs("div",{className:"w-[80%] max-w-none bg-base-100 rounded-xl border border-base-content/10 border-l-[3px] border-l-primary/70 hover:border-base-content/30 hover:bg-base-200/40 transition-all relative shadow-xs",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 px-3 py-2 min-h-[38px]",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:"relative z-10",children:a.jsx($E,{agentId:O.agent||Y.source,model:O.model||Y.model,timestamp:Y.timestamp,tooltipId:Pe,freshInputTokens:O.freshInputTokens,cacheReadTokens:O.cacheReadTokens,outputTokens:O.outputTokens,sessionId:Y.sessionId})}),a.jsx("span",{className:"font-mono text-xs text-base-content/60 truncate",children:O.model}),a.jsx("span",{className:"font-mono text-xs text-base-content/90 truncate min-w-0",children:BE(O.payload||O.title)})]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0 font-mono text-[11px] text-base-content/60",children:[a.jsxs("span",{children:["📤 ",Ce(O.outputTokens)]}),ye?a.jsx("button",{type:"button","aria-label":be?"Collapse response":"Expand response","aria-expanded":be,"aria-controls":we,onClick:()=>z(Y.key,O.seq),className:"p-1 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 inline-flex items-center justify-center text-base-content/60 hover:text-base-content transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary rounded after:absolute after:inset-0 after:rounded-xl after:content-['']",children:a.jsx("span",{className:`text-xs font-mono transition-transform duration-150 ${be?"rotate-90":""}`,"aria-hidden":"true",children:"›"})}):null]})]}),be&&O.payload&&a.jsx("div",{id:we,className:"p-3 bg-[#0d141f] text-slate-100 font-mono text-xs whitespace-pre-wrap overflow-x-auto rounded-b-xl border-t border-base-content/10 relative z-10",children:Gc(O.payload,O.toolName)})]}):a.jsxs("div",{className:"w-[80%] max-w-none bg-base-100 rounded-xl border border-base-content/10 border-l-[3px] hover:border-base-content/30 hover:bg-base-200/40 transition-all relative shadow-xs",style:{borderLeftColor:he.color},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 px-2.5 py-1.5 min-h-[38px]",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:"relative z-10",children:a.jsx($E,{agentId:O.agent||Y.source,model:O.model||Y.model,timestamp:Y.timestamp,tooltipId:Pe,freshInputTokens:O.freshInputTokens,cacheReadTokens:O.cacheReadTokens,outputTokens:O.outputTokens,sessionId:Y.sessionId})}),a.jsx("span",{className:"relative z-10",children:a.jsx(rx,{item:{toolName:he.label,seq:O.seq,status:O.exitCode===0?"ok":O.exitCode!==null?"error":"ok",durationMs:O.durationMs,durationSource:O.durationSource,tokens:{billedTokens:O.tokens,freshInputTokens:O.freshInputTokens,cacheReadTokens:O.cacheReadTokens,outputTokens:O.outputTokens,cacheSavedTokens:0},argsRaw:O.payload,sessionId:Y.sessionId??p,source:O.agent||Y.source,model:O.model||Y.model,ts:Y.timestamp,errorText:O.exitCode!==null&&O.exitCode!==0?O.payload||`Exit code ${O.exitCode}`:null},categoryColor:he.color,testId:`timeline-tool-badge-${ue}`,tooltipId:ue,size:"xs"})}),O.title&&O.title.trim().length>0?a.jsx("span",{className:"font-mono text-xs font-semibold text-base-content/90 truncate min-w-0",title:O.title,children:O.title}):null]}),a.jsxs("div",{className:"flex items-center gap-2 shrink-0 font-mono",children:[O.exitCode!==null&&a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold relative z-10 ${O.exitCode===0?"bg-emerald-500/20 text-emerald-400 border border-emerald-500/30":"bg-error/20 text-error border border-error/30"}`,children:["EXIT_CODE=",O.exitCode]}),ye?a.jsx("button",{type:"button","aria-label":be?"Collapse operation payload":"Expand operation payload","aria-expanded":be,"aria-controls":we,onClick:()=>z(Y.key,O.seq),className:"p-1 min-h-[44px] min-w-[44px] sm:min-h-0 sm:min-w-0 inline-flex items-center justify-center text-base-content/60 hover:text-base-content transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-primary rounded after:absolute after:inset-0 after:rounded-xl after:content-['']",children:a.jsx("span",{className:`text-xs font-mono transition-transform duration-150 ${be?"rotate-90":""}`,"aria-hidden":"true",children:"›"})}):null]})]}),be&&O.payload&&a.jsx("div",{id:we,className:"p-3 bg-[#0d141f] text-slate-100 font-mono text-xs whitespace-pre-wrap overflow-x-auto rounded-b-xl border-t border-base-content/10 relative z-10",children:Gc(O.payload,he.label)})]})})]},Cs(Y.key,O.seq))})]},Y.key)})})]})},Wa=xr,kv=({data:e,loading:t=!1,error:n=null,mode:r="session",onModeChange:s=()=>{},sessionId:i,sessionSource:o,availableSessions:l=[],onSelectSession:u=()=>{},toolNames:c=[],onToolNamesChange:d=()=>{},status:p="all",onStatusChange:f=()=>{},search:m="",onSearchChange:b=()=>{}})=>{const x=e?.items??[],y=e?.scope,E=g.useMemo(()=>{const A=new Set;for(const N of x)A.add(N.toolName);return Array.from(A).sort()},[x]),v=A=>{c.includes(A)?d(c.filter(N=>N!==A)):d([...c,A])},S=c.length>0||p!=="all"||m.trim().length>0;return a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl p-4 border border-base-content/10 flex flex-col gap-4 shadow-xs",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pb-3 border-b border-base-content/10",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsxs("div",{className:"inline-flex bg-base-300 p-1 rounded-xl border border-base-content/5 text-xs font-mono",children:[a.jsx("button",{type:"button",className:`px-3.5 py-1.5 font-bold rounded-lg transition-all cursor-pointer ${r==="session"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content hover:bg-base-content/5"}`,onClick:()=>s("session"),children:"Single Session"}),a.jsx("button",{type:"button",className:`px-3.5 py-1.5 font-bold rounded-lg transition-all cursor-pointer ${r==="consolidated"?"bg-primary text-primary-content shadow-xs":"text-base-content/70 hover:text-base-content hover:bg-base-content/5"}`,onClick:()=>s("consolidated"),children:"Consolidated Stream"})]}),r==="session"&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[o&&a.jsx("span",{className:"w-5 h-5 flex items-center justify-center text-base-content/80",children:a.jsx(or,{id:o})}),a.jsx("select",{className:"bg-base-300 border border-base-content/20 rounded-xl px-3 py-1.5 text-xs font-mono max-w-sm focus:outline-hidden focus:border-primary cursor-pointer text-base-content",value:i?`${o??""}:${i}`:"",onChange:A=>{const N=A.target.value,[T,...w]=N.split(":");T&&w.length>0&&u(T,w.join(":"))},children:l.map(A=>a.jsxs("option",{value:`${A.source}:${A.id}`,children:["[",A.source,"] ",A.id.slice(0,16),"... (",A.model,")"]},`${A.source}:${A.id}`))})]})]}),r==="consolidated"&&a.jsx("span",{className:"text-[11px] font-mono text-base-content/50 bg-base-300 px-2.5 py-1 rounded-full",children:"Consolidated across all window sessions"})]}),a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-3",children:[a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Total Calls"}),a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-lg font-bold font-mono text-base-content","data-testid":"tool-scope-calls",children:y?.totalCalls??0})})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Unique Tools"}),a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-lg font-bold font-mono text-base-content","data-testid":"tool-scope-unique",children:y?.uniqueTools??0})})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Errors / Rate"}),a.jsx("div",{className:"mt-1",children:a.jsxs("span",{className:`text-lg font-bold font-mono ${(y?.errorCount??0)>0?"text-error":"text-success"}`,"data-testid":"tool-scope-errors",children:[y?.errorCount??0," (",Math.round((y?.errorRate??0)*100),"%)"]})})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Mean Duration"}),a.jsxs("div",{className:"mt-1",children:[a.jsx("span",{className:"text-lg font-bold font-mono text-base-content","data-testid":"tool-scope-duration",children:y?.meanDurationMs?`${y.meanDurationMs} ms`:"—"}),(y?.durationUnmeasured??0)>0&&a.jsxs("span",{className:"text-[10px] text-base-content/50 ml-1 font-mono block",children:["(",y?.durationUnmeasured," unmeasured)"]})]})]}),a.jsxs("div",{className:"bg-base-300/60 rounded-xl p-3 border border-base-content/5 flex flex-col justify-between",children:[a.jsx("span",{className:"text-[10px] font-mono uppercase tracking-wider text-base-content/50",children:"Billed Tokens"}),a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-lg font-bold font-mono text-primary","data-testid":"tool-scope-tokens",children:y?Wa(y.tokens.billedTokens):0})})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-3 border-t border-base-content/10",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-base-content/60 font-semibold font-mono",children:"Status:"}),a.jsx("div",{className:"inline-flex bg-base-300 p-0.5 rounded-lg text-xs font-mono",children:["all","ok","error"].map(A=>a.jsx("button",{type:"button",className:`px-2.5 py-1 text-xs font-bold rounded-md transition-all cursor-pointer ${p===A?A==="error"?"bg-error text-error-content shadow-xs":"bg-base-content text-base-100 shadow-xs":"text-base-content/70 hover:bg-base-content/10"}`,onClick:()=>f(A),children:A.toUpperCase()},A))})]}),a.jsxs("div",{className:"flex-1 max-w-md relative",children:[a.jsx("span",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-xs opacity-40",children:"🔍"}),a.jsx("input",{type:"text",className:"bg-base-300 border border-base-content/20 rounded-xl pl-8 pr-7 py-1.5 w-full text-xs font-mono focus:outline-hidden focus:border-primary placeholder:text-base-content/40",placeholder:"Search tool arguments, digest, or error text...",value:m,onChange:A=>b(A.target.value)}),m&&a.jsx("button",{type:"button",onClick:()=>b(""),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-xs text-base-content/40 hover:text-base-content cursor-pointer",children:"✕"})]})]}),E.length>0&&a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pt-2 border-t border-base-content/5",children:[a.jsx("span",{className:"text-[11px] text-base-content/50 font-semibold font-mono",children:"Tools:"}),E.map(A=>{const N=c.includes(A);return a.jsx("button",{type:"button","data-testid":`tool-filter-${A}`,className:`px-2.5 py-0.5 rounded-full text-[11px] font-mono transition-all border cursor-pointer ${N?"bg-primary text-primary-content border-primary font-bold shadow-xs":"bg-base-300 text-base-content/80 border-base-content/10 hover:border-base-content/30"}`,onClick:()=>v(A),children:A},A)}),c.length>0&&a.jsxs("button",{type:"button",className:"text-[11px] text-base-content/60 hover:text-base-content underline ml-1 font-mono cursor-pointer",onClick:()=>d([]),children:["Clear (",c.length,")"]})]})]}),e?.truncated&&a.jsxs("div",{className:"bg-warning/10 text-warning border border-warning/20 p-3 rounded-xl text-xs font-medium flex items-center gap-2",children:[a.jsx("span",{children:"⚠️"}),a.jsxs("span",{children:["Showing the first ",x.length," tool calls. Refine your filters or search to narrow the scope."]})]}),n&&a.jsxs("div",{className:"bg-error/10 text-error border border-error/20 p-4 text-xs rounded-xl flex items-center gap-2",children:[a.jsx("span",{children:"⚠️"}),a.jsx("span",{children:n})]}),t&&x.length===0&&a.jsx("div",{className:"flex flex-col gap-2.5 animate-pulse",children:[1,2,3,4,5].map(A=>a.jsx("div",{className:"h-16 bg-base-200 rounded-xl border border-base-content/5"},A))}),!t&&!n&&x.length===0&&a.jsxs("div",{className:"bg-base-200/40 rounded-xl border border-base-content/10 p-12 text-center text-base-content/60 flex flex-col items-center gap-2",children:[a.jsx("span",{className:"text-3xl block mb-1",children:"🔍"}),a.jsx("p",{className:"text-sm font-semibold",children:"No tool calls found"}),a.jsx("p",{className:"text-xs max-w-sm",children:S?"No tool calls match your active filter criteria. Try clearing search or status filters.":"No tool invocations recorded for this scope."})]}),x.length>0&&a.jsx("div",{className:"flex flex-col gap-2 w-full",children:x.map(A=>{const N=`${A.sessionId}:${A.messageHash}:${A.toolSeq}`,T=Dl[A.category]??Dl.other,w=A.status==="error";return a.jsxs("div",{className:"w-full text-left group p-3 rounded-xl border border-base-content/10 hover:border-base-content/30 hover:bg-base-200/60 bg-base-200/30 transition-all flex items-center justify-between gap-3 relative","data-testid":`tool-item-${A.seq}`,children:[a.jsxs("div",{className:"flex items-center gap-2.5 min-w-0 flex-1",children:[a.jsx(UG,{agentId:A.source,model:A.model,timestamp:A.ts,freshInputTokens:A.tokens.freshInputTokens,cacheReadTokens:A.tokens.cacheReadTokens,outputTokens:A.tokens.outputTokens,sessionId:A.sessionId}),a.jsxs("span",{className:"text-xs font-mono text-base-content/40 font-bold min-w-[28px]",children:["#",A.seq]}),a.jsx($G,{item:A,categoryColor:T}),a.jsx("span",{className:"text-xs font-mono text-base-content/80 truncate min-w-0 flex-1",title:A.argsRaw||A.argsDigest||"",children:jG(A)})]}),a.jsxs("div",{className:"flex items-center gap-3 shrink-0 text-xs font-mono",children:[a.jsx("span",{className:"text-base-content/70 tabular-nums",title:`Duration source: ${A.durationSource}`,children:A.durationMs!==null?`${A.durationMs} ms`:"—"}),a.jsxs("span",{className:"text-base-content/50 text-[11px] tabular-nums",title:`Tokens: ${Wa(A.tokens.freshInputTokens)} fresh input, ${Wa(A.tokens.cacheReadTokens)} cache read, ${Wa(A.tokens.outputTokens)} output`,children:[Wa(A.tokens.billedTokens)," tok"]}),a.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider border ${w?"bg-error/15 text-error border-error/30":"bg-emerald-500/15 text-emerald-400 border-emerald-500/30"}`,children:[a.jsx("span",{className:"w-1 h-1 rounded-full bg-current"}),A.status]})]})]},N)})})]})},eW=[{id:"summary",label:"Summary",component:wv},{id:"timeline",label:"Timeline",component:Av},{id:"tool-using",label:"Tool Using",component:kv},{id:"sessions",label:"Sessions",component:Tv},{id:"insights",label:"Insights",component:Sv},{id:"sources",label:"Sources",component:Nv}],Wo=(e,t)=>{const n=new Map;for(const r of e)n.set(r.id,r);for(const r of t??[])n.has(r)||n.set(r,{id:r,label:r});return[...n.values()]},tW=e=>e.range==="1h"?"Last 1h":e.range==="4h"?"Last 4h":e.range==="24h"?"Last 24h":e.range==="7d"?"Last 7d":e.range==="30d"?"Last 30d":e.range==="all"?"All time":`${e.from?.slice(0,10)??"…"} → ${e.to?.slice(0,10)??"…"}`,Rs=e=>e instanceof Error?e.message:String(e),nW=()=>{const[e,t]=g.useState("summary"),[n,r]=g.useState({range:"4h",bucket:"auto",dimension:"model"}),[s,i]=g.useState("session"),[o,l]=g.useState(null),[u,c]=g.useState({taskWbs:"",runId:""}),[d,p]=g.useState("session"),[f,m]=g.useState([]),[b,x]=g.useState("all"),[y,E]=g.useState(""),[v,S]=g.useState(""),[A,N]=g.useState(1),[T,w]=g.useState("start"),[k,F]=g.useState("desc"),[C,$]=g.useState(void 0),[z,M]=g.useState(void 0),[G,H]=g.useState(void 0),[j,q]=g.useState(void 0),[re,pe]=g.useState(void 0),[I,Z]=g.useState(void 0),[ie,L]=g.useState([]),[Ee,fe]=g.useState(!1),[Y,me]=g.useState(!0),[te,O]=g.useState(null),[he,be]=g.useState(!0),[ye,we]=g.useState(null),[Pe,ue]=g.useState(!0),[Ye,at]=g.useState(null),[Qe,At]=g.useState(!1),[ft,dt]=g.useState(null),[Ot,qe]=g.useState(!1),[De,Ke]=g.useState(null),[Q,le]=g.useState(!1),[Ae,W]=g.useState(null);g.useEffect(()=>{let ne=!0;return me(!0),O(null),be(!0),we(null),Pt.history.getSummary(n).then(de=>{ne&&(de?.data?$(de.data):O("Failed to load summary"))}).catch(de=>{ne&&O(Rs(de))}).finally(()=>{ne&&me(!1)}),Pt.history.getInsights(n).then(de=>{ne&&(de?.data?pe(de.data):we("Failed to load insights"))}).catch(de=>{ne&&we(Rs(de))}).finally(()=>{ne&&be(!1)}),()=>{ne=!1}},[n]),g.useEffect(()=>{let ne=!0;return ue(!0),at(null),(async()=>{try{const de=await Pt.history.getSources();if(!ne)return;de?.data?Z(de.data):at("Failed to load sources")}catch(de){ne&&at(Rs(de))}finally{ne&&ue(!1)}})(),()=>{ne=!1}},[]),g.useEffect(()=>{if(e!=="timeline"&&e!=="tool-using")return;let ne=!0;return fe(!0),(async()=>{try{const de=await Pt.history.getSessions({filter:n,page:1,pageSize:100,sortBy:"start",sortDir:"desc"});if(!ne)return;const st=(de?.data?.items??[]).map(V=>({id:V.id,source:V.source,model:V.model,start:V.start,tokenLoad:V.freshInputTokens+V.cacheReadTokens+V.outputTokens}));L(st);const wt=st[0];wt&&!o&&l({source:wt.source,id:wt.id})}catch{ne&&L([])}finally{ne&&fe(!1)}})(),()=>{ne=!1}},[e,n,o]),g.useEffect(()=>{if(e!=="sessions")return;let ne=!0;return At(!0),dt(null),(async()=>{try{const de=await Pt.history.getSessions({filter:n,page:A,pageSize:20,sortBy:T,sortDir:k});if(!ne)return;de?.data?q(de.data):dt("Failed to load sessions")}catch(de){ne&&dt(Rs(de))}finally{ne&&At(!1)}})(),()=>{ne=!1}},[e,n,A,T,k]),g.useEffect(()=>{if(e!=="timeline")return;if(s==="session"&&!o){const de=ie[0];!Ee&&de&&l({source:de.source,id:de.id});return}let ne=!0;return qe(!0),Ke(null),(async()=>{try{const de=s==="session"&&o?await Pt.history.getTimeline({mode:"session",source:o.source,sessionId:o.id}):await Pt.history.getTimeline({mode:"consolidated",filter:n,...u.taskWbs?{taskWbs:u.taskWbs}:{},...u.runId?{runId:u.runId}:{}});if(!ne)return;de?.data?M(de.data):Ke("Failed to load timeline")}catch(de){ne&&Ke(Rs(de))}finally{ne&&qe(!1)}})(),()=>{ne=!1}},[e,s,o,n,Ee,ie,u]),g.useEffect(()=>{const ne=setTimeout(()=>{S(y)},250);return()=>clearTimeout(ne)},[y]),g.useEffect(()=>{if(e!=="tool-using")return;if(d==="session"&&!o){const de=ie[0];!Ee&&de&&l({source:de.source,id:de.id});return}let ne=!0;return le(!0),W(null),(async()=>{try{const de=d==="session"&&o?{mode:"session",source:o.source,sessionId:o.id,toolNames:f.length>0?f:void 0,status:b,search:v||void 0}:{mode:"consolidated",filter:n,toolNames:f.length>0?f:void 0,status:b,search:v||void 0},st=await Pt.history.getToolSequence(de);if(!ne)return;st?.data?H(st.data):W("Failed to load tool sequence")}catch(de){ne&&W(Rs(de))}finally{ne&&le(!1)}})(),()=>{ne=!1}},[e,d,o,n,f,b,v,Ee,ie]);const _e=(ne,de)=>{l({source:ne,id:de}),i("session"),t("timeline")},Be=(ne,de)=>{l({source:ne,id:de}),p("session")},ut=(ne,de)=>{const st=de?{source:de,id:ne}:j?.items.find(wt=>wt.id===ne)??ie.find(wt=>wt.id===ne);st&&_e(st.source,st.id)},mt=async ne=>(await Pt.history.triggerImport({mode:ne})).data,kt=te?"—":Y||C===void 0?"…":String(C.kpis.sessionsCount),yt=Ae?"—":Q||G===void 0?"…":String(G.scope.totalCalls),oe=ye?"—":he||re===void 0?"…":String(re.loops.length),Ne=Ye?"—":Pe||I===void 0?"…":String(I.agents.length),je={summary:null,timeline:null,"tool-using":yt,sessions:kt,insights:oe,sources:Ne},Ie=Ye?"—":Pe?"…":I?.overview.lastImportedAt?new Date(I.overview.lastImportedAt).toLocaleString():"never imported",gt=g.useMemo(()=>re?{count:re.loops.length,redundantCalls:re.loops.reduce((ne,de)=>ne+Math.max(0,de.repeats-1),0),wastedTokens:re.loops.reduce((ne,de)=>ne+de.wastedTokens,0)}:void 0,[re]),Ft=g.useMemo(()=>Wo(I?.agents.map(ne=>({id:ne.id,label:ne.name,color:ne.color}))??[],n.sources),[I?.agents,n.sources]),ve=g.useMemo(()=>Wo(C?.topModels.map(ne=>({id:ne.id,label:ne.label,color:ne.color}))??[],n.models),[C?.topModels,n.models]),He=g.useMemo(()=>Wo(C?.topTools.map(ne=>{const de=ne.id&&ne.id.trim()!==""?ne.id.trim():"unknown";return{id:de,label:de}})??[],n.tools?.map(ne=>ne&&ne.trim()!==""?ne.trim():"unknown")),[C?.topTools,n.tools]),$e=g.useMemo(()=>Wo(C?.skillsUsed.filter(ne=>ne.id&&ne.id.trim()!==""&&ne.id!=="unknown").map(ne=>({id:ne.id,label:ne.label,color:ne.color}))??[],n.skills?.filter(ne=>ne&&ne.trim()!==""&&ne!=="unknown")),[C?.skillsUsed,n.skills]),bt=g.useMemo(()=>({rangeLabel:tW(n),sessionCount:te?null:Y&&C===void 0?void 0:C?.kpis.sessionsCount,sourceCount:n.sources?.length??I?.agents.length}),[n,te,Y,C,I?.agents.length]);return a.jsxs("div",{className:"flex flex-col gap-4 p-4 max-w-[1600px] mx-auto w-full",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-base-content/10 pb-3",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl",children:"📊"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight",children:"Histories"}),a.jsx("p",{className:"text-xs text-base-content/60",children:"Transcript telemetry, session traces, and prompt cache analytics"}),a.jsxs("p",{className:"livechip mt-1 inline-flex items-center gap-1.5 rounded-full border border-base-content/10 px-2 py-0.5 text-xs text-base-content/60 font-mono","data-testid":"history-last-import",role:"status",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${Ye?"bg-error":"bg-emerald-400 animate-pulse"}`,"aria-hidden":"true"}),"last import ",Ie]})]})]}),a.jsx("div",{className:"flex items-center gap-1 bg-base-300 p-1 rounded-xl",children:eW.map(ne=>a.jsxs("button",{type:"button",className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${e===ne.id?"bg-primary text-primary-content font-bold shadow-sm":"text-base-content/70 hover:bg-base-content/10"}`,onClick:()=>t(ne.id),children:[ne.label,je[ne.id]!==null&&a.jsx("span",{className:"ml-1.5 px-1.5 py-0.5 rounded-full text-[10px] font-mono bg-base-content/10","data-testid":`history-badge-${ne.id}`,children:je[ne.id]})]},ne.id))})]}),e!=="sources"&&a.jsx(kG,{filter:n,onChange:r,sourceOptions:Ft,modelOptions:ve,toolOptions:He,skillOptions:$e,scope:bt}),a.jsxs("div",{className:"mt-2",children:[e==="summary"&&a.jsx(wv,{data:C,loading:Y,error:te,dimension:n.dimension??"model",onDimensionChange:ne=>r(de=>({...de,dimension:ne})),bucket:n.bucket??"auto",onBucketChange:ne=>r(de=>({...de,bucket:ne})),loopSummary:gt}),e==="timeline"&&a.jsx(Av,{data:z,loading:Ot,error:De,mode:s,sessionId:o?.id,sessionSource:o?.source,availableSessions:ie,onSelectSession:_e,onModeChange:i,consolidatedTaskWbs:u.taskWbs,consolidatedRunId:u.runId,onConsolidatedScopeSubmit:c}),e==="tool-using"&&a.jsx(kv,{data:G,loading:Q,error:Ae,mode:d,onModeChange:p,sessionId:o?.id,sessionSource:o?.source,availableSessions:ie,onSelectSession:Be,toolNames:f,onToolNamesChange:m,status:b,onStatusChange:x,search:y,onSearchChange:E}),e==="sessions"&&a.jsx(Tv,{data:j,loading:Qe,error:ft,sortBy:T,sortDir:k,page:A,pageSize:20,onSortChange:ne=>{T===ne?F(de=>de==="asc"?"desc":"asc"):(w(ne),F("desc"))},onPageChange:N,onSelectSession:_e}),e==="insights"&&a.jsx(Sv,{data:re,loading:he,error:ye,cacheHitTrend:C?.kpiTrend??[],onSelectSession:ut}),e==="sources"&&a.jsx(Nv,{data:I,loading:Pe,error:Ye,onTriggerImport:mt})]})]})},rW={id:"history",name:"History",icon:"📊",route:"history",component:nW,sidebarLabel:"Histories",description:"Imported agent sessions, token analytics, and tool-call forensics",order:20},sW=Object.freeze(Object.defineProperty({__proto__:null,module:rW},Symbol.toStringTag,{value:"Module"})),aW=["30s","5m","1h","4h","24h","7d","all"],iW={"30s":3e4,"5m":5*6e4,"1h":60*6e4,"4h":240*6e4,"24h":1440*6e4,"7d":10080*6e4,all:null};function Uu(e,t=Date.now()){const n=iW[e];if(n!=null)return new Date(t-n).toISOString()}function oW({timeRange:e,onTimeRangeChange:t}){return a.jsxs("fieldset",{className:"flex items-center gap-1 bg-base-200 p-1 rounded-lg border-0 m-0","aria-label":"Time range presets",children:[a.jsx("legend",{className:"sr-only",children:"Time range presets"}),aW.map(n=>{const r=e===n;return a.jsx("button",{type:"button",onClick:()=>t(n),"aria-pressed":r,className:`px-2.5 py-1 text-xs font-semibold rounded-md transition-all cursor-pointer ${r?"bg-primary text-primary-content font-bold shadow-sm":"text-base-content/70 hover:bg-base-content/10"}`,children:n==="all"?"All":n},n)})]})}function lW(e){return e.selectedPrefixes.size>0||e.searchQuery.trim()!==""||e.searchScope!=="all"||e.severity!=="all"||e.tierFilter!=="all"||e.runId.trim()!==""}function zE({label:e,value:t,onChange:n,options:r}){return a.jsxs("fieldset",{className:"flex items-center gap-0.5 bg-base-100 border border-base-content/20 rounded-md p-0.5","aria-label":e,children:[a.jsx("legend",{className:"sr-only",children:e}),r.map(s=>{const i=s.value===t;return a.jsxs("label",{className:`flex-1 text-[11px] text-center px-2 py-0.5 rounded cursor-pointer transition-all ${i?"bg-primary text-primary-content font-bold shadow-xs":"text-base-content/70 hover:bg-base-content/10"}`,children:[a.jsx("input",{type:"radio",name:`segmented-${e}`,value:s.value,checked:i,onChange:()=>n(s.value),className:"sr-only"}),s.label]},s.value)})]})}const HE="Retention: events capped at 10,000 rows per prefix · terminal jobs pruned after 30d";function _v(){return a.jsxs("span",{"data-testid":"observability-retention-badge",className:"inline-flex items-center gap-1 px-2.5 py-1 text-xs font-medium rounded-lg border border-base-content/15 bg-base-100 text-base-content/70 whitespace-nowrap",title:HE,children:[a.jsx("span",{"aria-hidden":"true",children:"ℹ️"}),a.jsx("span",{children:HE})]})}function uW({filters:e,onFiltersChange:t,onClearFilters:n,prefixOptions:r,getPrefixColor:s,liveEnabled:i,onToggleLive:o,shownCount:l,totalCount:u,actions:c}){const d=g.useMemo(()=>{let m=0;return e.selectedPrefixes.size>0&&(m+=e.selectedPrefixes.size),e.searchQuery.trim()!==""&&(m+=1),e.severity!=="all"&&(m+=1),e.tierFilter!=="all"&&(m+=1),e.runId.trim()!==""&&(m+=1),m},[e]),p=lW(e),f=m=>{t(b=>{const x=new Set(b.selectedPrefixes);return x.has(m)?x.delete(m):x.add(m),{...b,selectedPrefixes:x}})};return a.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 p-3 bg-base-200/50 rounded-xl border border-base-content/10 shrink-0",children:a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs("span",{"aria-live":"polite",className:"text-xs font-mono text-base-content/60 whitespace-nowrap","data-testid":"observability-result-count",children:[l," of ",u," shown"]}),a.jsxs("details",{className:"relative inline-block","data-testid":"observability-filter-disclosure",children:[a.jsxs("summary",{className:"px-2.5 py-1 text-xs font-medium rounded-lg border border-base-content/20 bg-base-200 text-base-content/80 hover:bg-base-300 transition-colors cursor-pointer list-none flex items-center gap-1.5 focus:outline-none focus:ring-2 focus:ring-primary/40","aria-label":"Toggle filter panel",children:[a.jsx("span",{children:"🔍 Filter"}),d>0&&a.jsx("span",{className:"px-1.5 py-0.2 rounded-full text-[10px] font-bold bg-primary text-primary-content",children:d})]}),a.jsxs("div",{className:"absolute right-0 top-full z-30 p-3 shadow-xl bg-base-200 border border-base-content/10 rounded-xl w-80 sm:w-96 mt-2 flex flex-col gap-3",children:[a.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-base-content/10",children:[a.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-base-content/70",children:"Filters"}),p&&a.jsx("button",{type:"button",onClick:n,className:"text-xs text-error hover:underline cursor-pointer","aria-label":"Clear all filters",children:"Clear all"})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("label",{htmlFor:"filter-search-input",className:"text-[11px] font-semibold text-base-content/60",children:"Search"}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsxs("select",{value:e.searchScope,onChange:m=>t(b=>({...b,searchScope:m.target.value})),className:"bg-base-100 border border-base-content/20 rounded px-2 py-1 text-xs text-base-content focus:outline-none focus:ring-2 focus:ring-primary/40 cursor-pointer","aria-label":"Search scope",children:[a.jsx("option",{value:"all",children:"all"}),a.jsx("option",{value:"name",children:"name"}),a.jsx("option",{value:"actor",children:"actor"}),a.jsx("option",{value:"payload",children:"payload"})]}),a.jsx(Ii,{id:"filter-search-input",size:"sm",variant:"bordered",placeholder:`Search ${e.searchScope}…`,value:e.searchQuery,onChange:m=>t(b=>({...b,searchQuery:m.target.value})),className:"flex-1 input-xs","aria-label":`Search ${e.searchScope}`})]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[11px] font-semibold text-base-content/60",children:"Severity"}),a.jsx(zE,{label:"Severity",value:e.severity,onChange:m=>t(b=>({...b,severity:m})),options:[{value:"all",label:"All"},{value:"info",label:"Info"},{value:"warning",label:"Warning"},{value:"error",label:"Error"}]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[11px] font-semibold text-base-content/60",children:"Tier"}),a.jsx(zE,{label:"Tier",value:e.tierFilter,onChange:m=>t(b=>({...b,tierFilter:m})),options:[{value:"all",label:"All"},{value:"default",label:"Default"},{value:"diagnostic",label:"Diagnostic"}]})]}),r.length>0&&a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("span",{className:"text-[11px] font-semibold text-base-content/60",children:"Prefix"}),a.jsxs("fieldset",{className:"flex flex-wrap items-center gap-1.5 border-0 p-0 m-0","aria-label":"Filter by prefix",children:[a.jsx("legend",{className:"sr-only",children:"Filter by prefix"}),r.map(m=>{const b=e.selectedPrefixes.has(m),x=s(m);return a.jsxs("button",{type:"button",role:"switch","aria-checked":b,"aria-label":`Prefix ${m}${b?" (selected)":""}`,onClick:()=>f(m),className:`px-2 py-0.5 rounded-full text-[11px] font-mono border transition-colors cursor-pointer ${b?`${x} border-current bg-base-100 font-bold`:"text-base-content/60 border-base-content/20 hover:bg-base-100"}`,children:[m,".*"]},m)})]})]}),a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("label",{htmlFor:"filter-run-id-input",className:"text-[11px] font-semibold text-base-content/60",children:"Run ID"}),a.jsx(Ii,{id:"filter-run-id-input",size:"sm",variant:"bordered",placeholder:"Filter by run id…",value:e.runId,onChange:m=>t(b=>({...b,runId:m.target.value})),className:"w-full input-xs","aria-label":"Filter by run id"})]})]})]}),a.jsx(_v,{}),a.jsx("button",{type:"button",onClick:o,className:`px-2.5 py-1 text-xs font-semibold rounded-lg border transition-all cursor-pointer flex items-center gap-1.5 ${i?"border-emerald-500/40 bg-emerald-500/10 text-emerald-500 hover:bg-emerald-500/20":"border-amber-500/40 bg-amber-500/10 text-amber-500 hover:bg-amber-500/20"}`,"aria-label":i?"Pause live event stream":"Resume live event stream","aria-pressed":i,children:a.jsx("span",{children:i?"⏸ Pause Live":"▶ Resume Live"})}),c]})})}const Qs=[{key:"time",label:"Time",description:"Event timestamp",defaultVisible:!0,sortable:!0,colWidth:"w-36"},{key:"severity",label:"Severity",description:"Diagnostic severity level",defaultVisible:!0,sortable:!0,colWidth:"w-24"},{key:"event",label:"Event",description:"Event name with domain prefix",defaultVisible:!0,sortable:!0,colWidth:"w-[15%]"},{key:"summary",label:"Summary",description:"Rendered human summary",defaultVisible:!0,sortable:!0,colWidth:"w-[20%]"},{key:"correlation",label:"Correlation",description:"Entity or run correlation identifier",defaultVisible:!0,sortable:!0,colWidth:"w-[16%]"},{key:"outcome",label:"Outcome",description:"Execution result or state change",defaultVisible:!0,sortable:!0,colWidth:"w-28"},{key:"agent",label:"Agent",description:"Target or actor agent role",defaultVisible:!0,sortable:!0,colWidth:"w-28"},{key:"producer",label:"Producer",description:"Subsystem or source package",defaultVisible:!1,sortable:!1,colWidth:"w-[16%]"},{key:"action",label:"Action",description:"Action link or remediation command",defaultVisible:!1,sortable:!1,colWidth:"w-[15%]"},{key:"actor",label:"Actor",description:"Originating user or system actor",defaultVisible:!1,sortable:!1,colWidth:"w-24"}],cW=new Set(Qs.map(e=>e.key)),Fr=["time","severity","event","summary","correlation","outcome","agent"],Cv="spur:observability:columns:v1";function dW(e){if(!Array.isArray(e)||e.length===0)return[...Fr];const t=new Set;for(const n of e)typeof n=="string"&&cW.has(n)&&t.add(n);return t.size===0?[...Fr]:Qs.filter(n=>t.has(n.key)).map(n=>n.key)}function pW(e){try{const t=e??(typeof window<"u"?window.localStorage:void 0);if(!t)return[...Fr];const n=t.getItem(Cv);if(!n)return[...Fr];const r=JSON.parse(n);return dW(r)}catch{return[...Fr]}}function GE(e,t){try{const n=t??(typeof window<"u"?window.localStorage:void 0);if(!n)return;n.setItem(Cv,JSON.stringify(e))}catch{}}function fW({visibleColumns:e,onVisibleColumnsChange:t}){const n=g.useMemo(()=>new Set(e),[e]),r=i=>{const o=new Set(n);if(o.has(i)){if(o.size<=1)return;o.delete(i)}else o.add(i);const l=Qs.filter(u=>o.has(u.key)).map(u=>u.key);t(l),GE(l)},s=()=>{const i=[...Fr];t(i),GE(i)};return a.jsxs("details",{className:"relative inline-block","data-testid":"observability-column-customizer",children:[a.jsxs("summary",{className:"px-2.5 py-1 text-xs font-medium rounded-lg border border-base-content/20 bg-base-200 text-base-content/80 hover:bg-base-300 transition-colors cursor-pointer list-none flex items-center gap-1.5 focus:outline-none focus:ring-2 focus:ring-primary/40","aria-label":"Customize visible columns",children:[a.jsx("span",{children:"📊 Columns"}),a.jsxs("span",{className:"text-[10px] text-base-content/60 font-mono",children:["(",e.length,"/",Qs.length,")"]})]}),a.jsxs("div",{className:"absolute right-0 top-full z-30 p-3 shadow-xl bg-base-200 border border-base-content/10 rounded-xl w-64 mt-2 flex flex-col gap-2",children:[a.jsxs("div",{className:"flex items-center justify-between pb-2 border-b border-base-content/10",children:[a.jsx("span",{className:"text-xs font-bold uppercase tracking-wide text-base-content/70",children:"Columns"}),a.jsx("button",{type:"button",onClick:s,className:"text-xs text-primary hover:underline cursor-pointer","aria-label":"Reset columns to default",children:"Reset defaults"})]}),a.jsxs("fieldset",{className:"flex flex-col gap-1.5 border-0 p-0 m-0","aria-label":"Visible columns",children:[a.jsx("legend",{className:"sr-only",children:"Select visible columns"}),Qs.map(i=>{const o=n.has(i.key),l=o&&n.size===1,u=`observability-col-${i.key}`;return a.jsxs("label",{htmlFor:u,className:`flex items-center justify-between px-2 py-1 rounded-md text-xs transition-colors ${l?"opacity-60 cursor-not-allowed":"hover:bg-base-100 cursor-pointer text-base-content/90"}`,children:[a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx(Mb,{id:u,size:"xs",variant:"primary",checked:o,disabled:l,onChange:()=>r(i.key),"aria-label":i.label}),a.jsx("span",{className:"font-medium",children:i.label})]}),i.defaultVisible&&a.jsx("span",{className:"text-[10px] text-base-content/50 uppercase",children:"default"})]},i.key)})]})]})]})}const mW=()=>`${nt()}/events/planning`,Zd=100;function Xd(e){const t=`${nt()}/events/history`,n=[],r=e.limit??Zd;return n.push(`limit=${r}`),e.prefix&&n.push(`prefix=${encodeURIComponent(e.prefix)}`),e.names&&n.push(`names=${encodeURIComponent(e.names)}`),e.actor&&n.push(`actor=${encodeURIComponent(e.actor)}`),e.runId&&n.push(`runId=${encodeURIComponent(e.runId)}`),e.since&&n.push(`since=${encodeURIComponent(e.since)}`),e.cursor&&n.push(`cursor=${encodeURIComponent(e.cursor)}`),`${t}?${n.join("&")}`}const hW={workflow:"text-cyan-400",task:"text-emerald-400",feature:"text-emerald-400",agent:"text-amber-400",rule:"text-rose-400",message:"text-sky-400",process:"text-violet-400",queue:"text-orange-400",bus:"text-pink-400",api:"text-teal-400"},WE="text-spur-text-muted";function Iv(e){return e?hW[e]??WE:WE}const qc={selectedPrefixes:new Set,searchQuery:"",searchScope:"all",severity:"all",tierFilter:"all",runId:""};function gW(){const e=g.useRef([]),[t,n]=g.useState(0);g.useEffect(()=>{const s=window.setInterval(()=>{const i=Date.now()-6e4,o=e.current.filter(l=>l>=i);e.current=o,n(o.length)},1e3);return()=>window.clearInterval(s)},[]);const r=g.useCallback(()=>{const s=Date.now(),i=s-6e4,o=e.current.filter(l=>l>=i);o.push(s),e.current=o,n(o.length)},[]);return{rate:t,recordEvent:r}}function Qd(e){if(e===null||typeof e!="object"||!("events"in e)||!("count"in e))return null;const t=e.events;if(!Array.isArray(t))return null;const n=e.count;if(typeof n!="number")return null;const r=e.nextCursor,s=typeof r=="string"?r:null,i=e.hasMore,o=typeof i=="boolean"?i:!1,l=[];for(const d of t){const p=bW(d);p&&l.push(p)}const u=e.catalog,c=Array.isArray(u)?xW(u):void 0;return{events:l,count:n,nextCursor:s,hasMore:o,...c?{catalog:c}:{}}}function bW(e){if(e===null||typeof e!="object")return null;const t=e;if(typeof t.id!="string"||typeof t.eventName!="string"||typeof t.occurredAt!="string")return null;const n=typeof t.prefix=="string"?t.prefix:void 0,r=typeof t.renderer=="string"?t.renderer:void 0,s=t.actor;if(s!==null&&typeof s!="string")return null;const i=t.payload,o=typeof t.runId=="string"?t.runId:t.runId===null?null:void 0,l=typeof t.entityKind=="string"?t.entityKind:t.entityKind===null?null:void 0,u=typeof t.entityId=="string"?t.entityId:t.entityId===null?null:void 0,c=typeof t.sequence=="number"&&Number.isFinite(t.sequence)?t.sequence:t.sequence===null?null:void 0,d={id:t.id,eventName:t.eventName,occurredAt:t.occurredAt,actor:s,...n?{prefix:n}:{},...r?{renderer:r}:{}};if(i===null)return{...d,payload:null,view:cs(t.eventName,null),...jl(o,l,u,c)};if(typeof i!="object")return null;const p=i,f=p.schemaVersion===2?p:void 0;return{...d,payload:Rv(p),...f?{envelope:f}:{},view:cs(t.eventName,p),...jl(o,l,u,c)}}function jl(e,t,n,r){const s={};return e!==void 0&&(s.runId=e),t!==void 0&&(s.entityKind=t),n!==void 0&&(s.entityId=n),r!==void 0&&(s.sequence=r),s}function xW(e){const t=[];for(const n of e){if(n===null||typeof n!="object")return;const r=n;if(typeof r.name!="string"||typeof r.prefix!="string"||typeof r.source!="string"||typeof r.renderer!="string")return;const s=typeof r.tier=="string"?r.tier:void 0,i={name:r.name,prefix:r.prefix,source:r.source,renderer:r.renderer,...s!==void 0?{tier:s}:{}};t.push(i)}return t}function yW(e){if(e===null||typeof e!="object")return null;const t=e;if(typeof t.eventName!="string"||t.eventName.length===0||typeof t.occurredAt!="string")return null;const n=typeof t.prefix=="string"?t.prefix:void 0,r=typeof t.renderer=="string"?t.renderer:void 0,s=t.actor;if(s!==null&&typeof s!="string")return null;const i=t.payload;if(i!==null&&typeof i!="object")return null;const o=i,l=o?.schemaVersion===2?o:void 0,u=Rv(o),c=t.runId??u?.runId,d=t.entityKind??u?.entityKind,p=t.entityId??u?.entityId,f=t.sequence??u?.sequence,m=typeof c=="string"?c:c===null?null:void 0,b=typeof d=="string"?d:d===null?null:void 0,x=typeof p=="string"?p:p===null?null:void 0,y=typeof f=="number"&&Number.isFinite(f)?f:f===null?null:void 0;return{eventName:t.eventName,occurredAt:t.occurredAt,actor:s,...n?{prefix:n}:{},...r?{renderer:r}:{},payload:u,...l?{envelope:l}:{},view:cs(t.eventName,o),...jl(m,b,x,y)}}function cs(e,t){const n=EW(e);if(t?.schemaVersion!==2)return n;const r=Ir(t.context),s=Ir(t.presentation),i=Ir(r?.project),o=Ir(r?.producer),l=Ir(r?.correlation);if(!r||!s||!i||!o||!l)return n;const u=s.severity==="info"||s.severity==="warning"||s.severity==="error"?s.severity:"warning",c=Array.isArray(s.fields)?s.fields.flatMap(v=>{const S=Ir(v),A=en(S?.label,64),N=en(S?.value,256);return A&&N?[{label:A,value:N}]:[]}).slice(0,8):[],d=[],p=(v,S)=>{const A=en(S,128);A&&d.push({label:v,value:A})};p("Run",l.runId),p("Execution",l.executionId),p("Action",l.actionId),p("Entity",TW(l.entityKind,l.entityId)),p("Job",l.jobId),typeof l.sequence=="number"&&Number.isFinite(l.sequence)&&d.push({label:"Sequence",value:String(l.sequence)});const f=en(o.package,128)??"unavailable",m=en(o.subsystem,128),b=SW(s.action),x=en(s.actionLabel,128)??"unavailable",y=en(s.agent,128),E=en(s.correlators,512);return{severity:u,summary:en(s.summary,512)??"unavailable",description:en(s.description,512)??"Description unavailable.",fields:c,projectName:en(i.name,128)??"unavailable",projectRoot:en(i.root,256)??"unavailable",producer:m?`${f} / ${m}`:f,correlation:E??"unavailable",correlationFields:d,outcome:en(s.outcome,128)??"unavailable",action:b,actionLabel:x,agent:y}}function EW(e){return{severity:"warning",summary:"unavailable",description:`Canonical context unavailable for ${en(e,128)??"unknown"}.`,fields:[],projectName:"unavailable",projectRoot:"unavailable",producer:"unavailable",correlation:"unavailable",correlationFields:[],outcome:"unavailable",action:null,actionLabel:"unavailable",agent:null}}function SW(e){const t=Ir(e);if(!t||t.kind!=="command"&&t.kind!=="filter"&&t.kind!=="path")return null;const n=en(t.label,128),r=en(t.value,256);return n&&r?{label:n,kind:t.kind,value:r}:null}function en(e,t){return typeof e!="string"||e.length===0?null:e.length<=t?e:`${e.slice(0,t-1)}…`}function TW(e,t){const n=en(e,64),r=en(t,128);return n&&r?`${n}:${r}`:n??r}const NW=["Entity","Run","Execution","Action","Job"];function wW(e,t){for(const n of NW){const r=t.correlationFields.find(s=>s.label===n);if(r!==void 0&&r.value!=="")return`${e.eventName} · ${r.value}`}return e.id!==""&&!e.id.startsWith("live-")?`${e.eventName} · ${e.id}`:e.eventName}function Ir(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function Rv(e){return e?.schemaVersion!==2?e:Ir(e.data)}const vW=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function qE(e){const t=new Date(e);if(Number.isNaN(t.getTime()))return e;const n=vW[t.getMonth()],r=t.getDate(),s=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0"),o=String(t.getSeconds()).padStart(2,"0");return`${n} ${r} ${s}:${i}:${o}`}function Dv(e){return typeof e!="number"||!Number.isFinite(e)?null:e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`}function ht(e){return e&&e!=="unavailable"?e:"-"}function AW(e,t){const n={};e.selectedPrefixes&&e.selectedPrefixes.size===1&&(n.prefix=[...e.selectedPrefixes][0]);const r=e.searchQuery?.trim()??"";r!==""&&e.searchScope==="name"&&(n.names=r),r!==""&&e.searchScope==="actor"&&(n.actor=r),e.runId&&e.runId.trim()!==""&&(n.runId=e.runId.trim());const s=Uu(t);return s&&(n.since=s),n}function VE(e,t,n){if(t.selectedPrefixes.size>=1){const r=e.prefix??e.eventName.split(".")[0]??e.eventName;if(!t.selectedPrefixes.has(r))return!1}if(t.tierFilter!=="all"){const r=n.get(e.eventName);if(r!==t.tierFilter&&!(t.tierFilter==="default"&&r===void 0))return!1}if(t.severity!=="all"&&(e.view??cs(e.eventName,e.payload??null)).severity!==t.severity)return!1;if(t.searchQuery.trim()!==""){const r=t.searchQuery.toLowerCase();let s=!1;if((t.searchScope==="name"||t.searchScope==="all")&&(s=s||e.eventName.toLowerCase().includes(r)),(t.searchScope==="actor"||t.searchScope==="all")&&(s=s||(e.actor?.toLowerCase().includes(r)??!1)),t.searchScope==="payload"&&e.payload&&(s=s||JSON.stringify(e.payload).toLowerCase().includes(r)),!s)return!1}return!(t.runId.trim()!==""&&e.runId!==t.runId.trim())}const sx={key:"time",direction:"desc"};function kW(e,t=sx){const n=e.map((r,s)=>({row:r,idx:s}));return n.sort((r,s)=>{let i=0;const o=r.row.view??cs(r.row.eventName,r.row.payload??null),l=s.row.view??cs(s.row.eventName,s.row.payload??null);switch(t.key){case"time":{const u=Date.parse(r.row.occurredAt),c=Date.parse(s.row.occurredAt),d=Number.isNaN(u)?-1/0:u,p=Number.isNaN(c)?-1/0:c;i=d-p;break}case"severity":{const u=c=>c==="info"?0:c==="warning"?1:2;i=u(o.severity)-u(l.severity);break}case"event":{i=r.row.eventName.localeCompare(s.row.eventName);break}case"summary":{i=(o.summary??"").localeCompare(l.summary??"");break}case"correlation":{i=(o.correlation??"").localeCompare(l.correlation??"");break}case"agent":{i=(o.agent??"").localeCompare(l.agent??"");break}case"outcome":{i=(o.outcome??"").localeCompare(l.outcome??"");break}default:i=0}return i!==0?t.direction==="asc"?i:-i:r.idx-s.idx}),n.map(r=>r.row)}function qo({value:e,label:t}){const[n,r]=g.useState("idle"),s=async i=>{i.preventDefault(),i.stopPropagation();try{typeof navigator<"u"&&navigator.clipboard?.writeText?(await navigator.clipboard.writeText(e),r("copied"),setTimeout(()=>r("idle"),1500)):(r("failed"),setTimeout(()=>r("idle"),2e3))}catch{r("failed"),setTimeout(()=>r("idle"),2e3)}};return!e||e==="-"||e==="unavailable"?null:a.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center justify-center p-0.5 rounded text-base-content/40 hover:text-base-content hover:bg-base-content/10 transition-colors cursor-pointer shrink-0 text-[10px] focus:outline-none focus:ring-1 focus:ring-primary/40",title:n==="copied"?"Copied":n==="failed"?"Copy failed":`Copy ${t}`,"aria-label":n==="copied"?`Copied ${t}`:n==="failed"?`Copy ${t} failed`:`Copy ${t}`,children:[a.jsx("span",{"aria-hidden":"true",children:n==="copied"?"✓":n==="failed"?"!":"📋"}),a.jsx("span",{className:"sr-only","aria-live":"polite",children:n==="copied"?`${t} copied`:n==="failed"?`${t} copy failed`:""})]})}function _W({onLivenessChange:e,timeRange:t}){const[n,r]=g.useState(()=>pW()),[s,i]=g.useState(sx),o=g.useCallback(fe=>{i(Y=>Y.key===fe?{key:fe,direction:Y.direction==="asc"?"desc":"asc"}:{key:fe,direction:"asc"})},[]),[l,u]=g.useState(!0),[c,d]=g.useState([]),[p,f]=g.useState([]),[m,b]=g.useState("idle"),[x,y]=g.useState(null),[E,v]=g.useState(null),[S,A]=g.useState(!1),[N,T]=g.useState(!1),[w,k]=g.useState(qc),[F,C]=g.useState(qc),[$,z]=g.useState("connecting"),{rate:M,recordEvent:G}=gW();g.useEffect(()=>{e?.({status:l?$:"paused",rate:M,lastEventAt:c[0]?.occurredAt??null})},[l,$,M,c,e]);const H=g.useMemo(()=>{const fe=new Map;for(const Y of p)Y.tier&&fe.set(Y.name,Y.tier);return fe},[p]);g.useEffect(()=>{const fe=window.setTimeout(()=>{C(w)},250);return()=>window.clearTimeout(fe)},[w]);const j=g.useMemo(()=>AW(F,t),[F,t]),q=g.useRef(0);g.useEffect(()=>{const fe=++q.current,Y=new AbortController;return b("loading"),y(null),(async()=>{try{const me=await Ge(new Request(Xd({...j,limit:Zd}),{signal:Y.signal}));if(!me.ok){const he=await me.json().catch(()=>null),be=he?.code;throw be==="UNKNOWN_PREFIX"||be==="MALFORMED_CURSOR"?new Error(`${be}: ${he.error??me.status}`):new Error(`history fetch failed: ${me.status}`)}const te=await me.json(),O=Qd(te);if(!O)throw new Error("history response failed schema validation");if(fe!==q.current)return;d(O.events),O.catalog&&f(O.catalog),v(O.nextCursor),A(O.hasMore),b("loaded")}catch(me){if(Y.signal.aborted||fe!==q.current)return;y(me instanceof Error?me.message:String(me)),b("error")}})(),()=>Y.abort()},[j]);const re=g.useCallback(async()=>{if(!(!S||N||E===null)){T(!0);try{const fe=await Ge(new Request(Xd({...j,limit:Zd,cursor:E})));if(!fe.ok)throw new Error(`history fetch failed: ${fe.status}`);const Y=await fe.json(),me=Qd(Y);if(!me)throw new Error("history response failed schema validation");d(te=>{const O=new Set(te.map(be=>be.id)),he=me.events.filter(be=>!O.has(be.id));return[...te,...he]}),me.catalog&&f(me.catalog),v(me.nextCursor),A(me.hasMore)}catch(fe){y(fe instanceof Error?fe.message:String(fe))}finally{T(!1)}}},[S,N,E,j]),pe=g.useRef(w);pe.current=w;const I=g.useRef(H);I.current=H,g.useEffect(()=>{if(!l||typeof EventSource>"u")return;z("connecting");const fe=new EventSource(mW());return fe.onopen=()=>{z("live")},fe.onerror=()=>{z("errored")},fe.onmessage=Y=>{try{const me=JSON.parse(Y.data),te=yW(me);if(!te||te.eventName==="connected")return;const O=pe.current,he=I.current;if(!VE({eventName:te.eventName,occurredAt:te.occurredAt,actor:te.actor,...te.prefix?{prefix:te.prefix}:{},payload:te.payload,view:te.view,...te.runId!==void 0?{runId:te.runId}:{}},O,he))return;const be={id:`live-${te.occurredAt}-${te.eventName}`,eventName:te.eventName,occurredAt:te.occurredAt,actor:te.actor,...te.prefix?{prefix:te.prefix}:{},...te.renderer?{renderer:te.renderer}:{},payload:te.payload,...te.envelope?{envelope:te.envelope}:{},view:te.view,...jl(te.runId,te.entityKind,te.entityId,te.sequence)};d(ye=>[be,...ye]),G()}catch{}},()=>fe.close()},[l,G]);const Z=g.useMemo(()=>Array.from(new Set([...p.map(fe=>fe.prefix),...c.map(fe=>fe.prefix??fe.eventName.split(".")[0]??fe.eventName)])).sort(),[p,c]),ie=g.useCallback(()=>{k(qc)},[]),L=g.useMemo(()=>c.filter(fe=>VE(fe,w,H)),[c,w,H]),Ee=g.useMemo(()=>kW(L,s),[L,s]);return m==="error"?a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load event history: ",x]}):m==="idle"||m==="loading"?a.jsxs("div",{className:"flex items-center justify-center h-32 text-spur-text-muted text-sm",children:[a.jsx(Ss,{size:"sm"})," Loading event history…"]}):a.jsxs("div",{className:"flex flex-col gap-4","data-system-events-tab":!0,children:[a.jsx(uW,{filters:w,onFiltersChange:k,onClearFilters:ie,prefixOptions:Z,getPrefixColor:Iv,liveEnabled:l,onToggleLive:()=>u(fe=>!fe),shownCount:L.length,totalCount:c.length,actions:a.jsx(fW,{visibleColumns:n,onVisibleColumnsChange:r})}),a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-sm border border-base-content/10 overflow-hidden flex flex-col",children:[Ee.length===0?a.jsx("div",{className:"p-8 text-sm text-spur-text-muted italic text-center",children:c.length===0?"No system events yet. New events from the planning bus will appear here in real time.":"No events match the active filters."}):a.jsx(IW,{rows:Ee,catalog:p,visibleColumns:n,sortState:s,onSortChange:o}),S&&a.jsx("div",{className:"px-4 py-2 border-t border-base-content/10 bg-base-200/50 shrink-0 flex justify-center",children:a.jsx("button",{type:"button",onClick:re,disabled:N,"data-load-older":!0,className:"text-[11px] text-spur-text-muted hover:text-spur-text px-3 py-1 rounded border border-spur-border/40 hover:border-spur-text/40 transition-colors cursor-pointer disabled:opacity-50 disabled:cursor-wait focus:outline-none focus:ring-2 focus:ring-spur-text/40",children:N?"Loading…":"Load older"})})]})]})}function CW(e){const[t,n]=g.useState(()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(e).matches);return g.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const r=window.matchMedia(e),s=i=>n(i.matches);return r.addEventListener("change",s),n(r.matches),()=>r.removeEventListener("change",s)},[e]),t}function IW({rows:e,catalog:t,visibleColumns:n=Fr,sortState:r=sx,onSortChange:s=()=>{}}){const i=g.useMemo(()=>{const u=new Map;for(const c of t)c.tier&&u.set(c.name,c.tier);return u},[t]),o=CW("(max-width: 639px)"),l=g.useMemo(()=>new Map(Qs.map(u=>[u.key,u])),[]);return a.jsx("section",{className:"overflow-x-auto min-w-0","data-system-events-tab":!0,"aria-label":"System events",children:a.jsxs("table",{className:`w-full ${o?"min-w-0":"min-w-[1000px]"} text-xs border-separate border-spacing-0 table-fixed`,children:[a.jsx("colgroup",{children:o?a.jsxs(a.Fragment,{children:[a.jsx("col",{className:"w-24"}),a.jsx("col",{className:"w-full"})]}):n.map(u=>a.jsx("col",{className:l.get(u)?.colWidth??"w-24"},u))}),a.jsx("thead",{className:"sticky top-0 z-10 bg-base-200",children:a.jsx("tr",{className:"text-left text-spur-text-muted uppercase tracking-wide text-[10px]",children:o?a.jsxs(a.Fragment,{children:[a.jsx("th",{scope:"col",className:"font-semibold px-3 py-1.5 border-b border-spur-border",children:"Time"}),a.jsx("th",{scope:"col",className:"font-semibold px-3 py-1.5 border-b border-spur-border",children:"Event"})]}):n.map(u=>{const c=l.get(u);if(!c)return null;const d=r.key===u,p=d?r.direction==="asc"?" ▲":" ▼":"",f=d?r.direction==="asc"?"ascending":"descending":"none";return c.sortable?a.jsx("th",{scope:"col","aria-sort":f,className:"font-semibold px-3 py-1.5 border-b border-spur-border select-none",children:a.jsxs("button",{type:"button",onClick:()=>s(u),className:"flex items-center gap-1 uppercase tracking-wide text-[10px] font-semibold text-spur-text-muted hover:text-spur-text transition-colors cursor-pointer bg-transparent border-0 p-0 focus:outline-none focus:ring-1 focus:ring-primary/40 rounded",children:[a.jsx("span",{children:c.label}),p&&a.jsx("span",{"aria-hidden":"true",children:p})]})},u):a.jsx("th",{scope:"col",className:"font-semibold px-3 py-1.5 border-b border-spur-border",children:c.label},u)})})}),a.jsx("tbody",{children:e.map(u=>a.jsx(RW,{event:u,tier:i.get(u.eventName)??"default",compact:o,visibleColumns:n},u.id))})]})})}const Vc="system-events-payload-tooltip-pin";function Yc({severity:e}){const t=g.useMemo(()=>{switch(e){case"error":return{icon:"✕",badgeClass:"bg-error/15 text-error border-error/30"};case"warning":return{icon:"▲",badgeClass:"bg-warning/15 text-warning border-warning/30"};default:return{icon:"●",badgeClass:"bg-base-content/10 text-base-content/70 border-base-content/20"}}},[e]);return a.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[10px] font-semibold border ${t.badgeClass} whitespace-nowrap`,children:[a.jsx("span",{"aria-hidden":"true",children:t.icon}),a.jsx("span",{children:e})]})}function RW({event:e,tier:t,compact:n,visibleColumns:r=Fr}){const s=e.prefix??e.eventName.split(".")[0]??e.eventName,i=g.useMemo(()=>e.view??cs(e.eventName,e.payload??null),[e.eventName,e.payload,e.view]),o=Iv(s),[l,u]=g.useState(!1),[c,d]=g.useState(!1),[p,f]=g.useState(!1),[m,b]=g.useState(null),x=g.useRef(null),y=g.useRef(null),E=g.useRef(0),v=g.useRef(null),S=ht(e.actor),A=c||p,N=g.useCallback(()=>{v.current!==null&&(clearTimeout(v.current),v.current=null)},[]),T=g.useCallback(()=>{f(!1),b(null)},[]),w=g.useCallback((M,G)=>{E.current=performance.now()+400,f(!0),d(!1),N();const H=Number.isFinite(M)&&M>0?M:8,j=Number.isFinite(G)&&G>0?G:8;b({x:H,y:j}),window.dispatchEvent(new CustomEvent(Vc,{detail:{id:e.id}}))},[e.id,N]),k=g.useCallback((M,G,H)=>{const j=M.getBoundingClientRect(),q=G&&G>0?G:j.left,re=H&&H>0?H+4:j.bottom+6;w(q,re)},[w]);g.useEffect(()=>{const M=G=>{G.detail?.id!==e.id&&T()};return window.addEventListener(Vc,M),()=>window.removeEventListener(Vc,M)},[e.id,T]),g.useEffect(()=>{if(!p)return;const M=H=>{performance.now()<E.current||x.current?.contains(H.target)||y.current?.contains(H.target)||T()},G=H=>{H.key==="Escape"&&(T(),H.stopPropagation())};return document.addEventListener("pointerdown",M,!0),document.addEventListener("keydown",G,!0),()=>{document.removeEventListener("pointerdown",M,!0),document.removeEventListener("keydown",G,!0)}},[p,T]),g.useEffect(()=>()=>{N()},[N]);const F=g.useCallback(()=>u(M=>!M),[]),C=g.useCallback(M=>{if(M.key==="Escape"){if(p){T(),M.stopPropagation();return}u(!1),M.stopPropagation()}},[p,T]),$=A?a.jsxs("div",{ref:x,id:`system-event-tooltip-${e.id}`,role:"tooltip","data-testid":"system-event-payload-tooltip","data-pinned":p?"true":"false",className:p?"pointer-events-auto fixed z-50 rounded shadow-lg p-2.5 text-[11px] min-w-[min(400px,90vw)] max-w-[min(840px,95vw)] whitespace-normal border border-[#30363d] bg-[#0d1117] text-[#c9d1d9] select-text cursor-text":"pointer-events-auto absolute left-0 top-full mt-1 z-30 rounded shadow-lg p-2.5 text-[11px] min-w-[min(400px,90vw)] max-w-[min(840px,95vw)] whitespace-normal border border-[#30363d] bg-[#0d1117] text-[#c9d1d9]",style:p&&m?{top:m.y,left:m.x}:void 0,onMouseEnter:()=>{N(),d(!0)},onMouseLeave:()=>{p||(N(),v.current=setTimeout(()=>d(!1),150))},onFocusCapture:()=>d(!0),onBlurCapture:M=>{!p&&!M.currentTarget.contains(M.relatedTarget)&&d(!1)},onPointerDown:M=>{p&&M.stopPropagation()},children:[a.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[a.jsx("div",{className:"text-[11px] font-sans font-semibold text-[#c9d1d9] truncate","data-testid":"system-event-tooltip-title",children:wW(e,i)}),a.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[!p&&a.jsx("button",{type:"button","data-testid":"system-event-payload-tooltip-pin",className:"text-[10px] text-[#c9d1d9] hover:text-white px-1.5 py-0.5 rounded border border-[#30363d] bg-[#21262d] cursor-pointer",onClick:M=>{M.stopPropagation(),M.preventDefault();const G=y.current;G?k(G):w(M.clientX,M.clientY)},children:"Pin"}),p&&a.jsx("button",{type:"button","data-testid":"system-event-payload-tooltip-close",className:"text-[10px] text-[#8b949e] hover:text-[#c9d1d9] px-1 rounded border border-[#30363d] cursor-pointer",onClick:M=>{M.stopPropagation(),T()},children:"close"})]})]}),a.jsx("p",{className:"mb-2 text-spur-text leading-relaxed","data-testid":"system-event-description",children:i.description}),a.jsxs("dl",{className:"grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1 max-h-80 overflow-y-auto",children:[a.jsx("dt",{className:"text-spur-text-muted",children:"Summary"}),a.jsx("dd",{className:"break-words",children:ht(i.summary)}),a.jsx("dt",{className:"text-spur-text-muted",children:"Severity"}),a.jsx("dd",{children:a.jsx(Yc,{severity:i.severity})}),i.fields.map(M=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"text-spur-text-muted",children:M.label}),a.jsx("dd",{className:"font-mono break-all",children:ht(M.value)})]},M.label+M.value)),a.jsx("dt",{className:"text-spur-text-muted",children:"Producer"}),a.jsx("dd",{className:"font-mono break-all",children:ht(i.producer)}),i.correlationFields.length>0?i.correlationFields.map(M=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"text-spur-text-muted",children:M.label}),a.jsx("dd",{className:"font-mono break-all",children:ht(M.value)})]},`correlation-${M.label}`)):a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-spur-text-muted",children:"Correlation"}),a.jsx("dd",{className:"font-mono",children:"-"})]}),a.jsx("dt",{className:"text-spur-text-muted",children:"Outcome"}),a.jsx("dd",{className:"font-mono break-all",children:ht(i.outcome)})]}),i.action&&a.jsxs("div",{className:"mt-2 border-t border-[#30363d] pt-2","data-testid":"system-event-remediation",children:[a.jsx("div",{className:"text-spur-text-muted",children:i.action.label}),a.jsx("code",{className:"block mt-0.5 font-mono break-all select-text",children:i.action.value})]}),a.jsx("div",{className:"mt-2 border-t border-[#30363d] pt-1.5 text-[10px] text-[#8b949e] font-sans","data-testid":"system-event-tooltip-footer",children:p?"Select to copy · Esc or outside click to close":"Click event name or Pin to lock for copy"})]}):null,z=M=>{switch(M){case"time":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-spur-text-muted whitespace-nowrap align-middle",children:qE(e.occurredAt)},"time");case"severity":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 align-middle text-[10px]",children:a.jsx(Yc,{severity:i.severity})},"severity");case"event":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 relative align-middle min-w-0",children:a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("button",{type:"button","aria-expanded":l,"aria-controls":`detail-${e.id}`,"aria-label":`${l?"Collapse":"Expand"} detail for ${e.eventName}`,onClick:F,onKeyDown:C,className:"inline-flex items-center justify-center w-4 h-4 text-spur-text-muted hover:text-spur-text text-[10px] transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-spur-text/40 shrink-0",children:l?"▾":"▸"}),a.jsxs("div",{className:"relative min-w-0 max-w-full flex items-center gap-1",children:[a.jsx("button",{ref:y,type:"button",className:`font-mono font-semibold truncate block max-w-full text-left cursor-pointer bg-transparent border-0 p-0 ${o}`,"data-testid":"system-event-name","aria-label":`Context for ${e.eventName}. Hover to preview; click to pin for select and copy.`,"aria-describedby":A?`system-event-tooltip-${e.id}`:void 0,onMouseEnter:()=>{N(),d(!0)},onFocus:()=>{N(),d(!0)},onBlur:G=>{!p&&!x.current?.contains(G.relatedTarget)&&d(!1)},onMouseLeave:()=>{N(),v.current=setTimeout(()=>{p||d(!1)},200)},onClick:G=>{G.preventDefault(),G.stopPropagation(),!p&&k(G.currentTarget,G.clientX,G.clientY)},onKeyDown:G=>{if(G.key==="Enter"||G.key===" "){if(G.preventDefault(),p)return;k(G.currentTarget)}},children:e.eventName}),a.jsx(qo,{value:e.eventName,label:"event name"}),!p&&$]})]})},"event");case"summary":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 text-spur-text align-middle truncate",title:ht(i.summary),children:ht(i.summary)},"summary");case"correlation":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle",children:a.jsxs("div",{className:"flex items-center gap-1 min-w-0",children:[a.jsx("span",{className:"truncate",title:ht(i.correlation),children:ht(i.correlation)}),i.correlation&&i.correlation!=="unavailable"&&a.jsx(qo,{value:i.correlation,label:"correlation"})]})},"correlation");case"outcome":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:ht(i.outcome),children:ht(i.outcome)},"outcome");case"agent":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:i.agent??"",children:i.agent??""},"agent");case"producer":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:ht(i.producer),children:ht(i.producer)},"producer");case"action":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:ht(i.actionLabel),children:ht(i.actionLabel)},"action");case"actor":return a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-[10px] text-spur-text-muted align-middle truncate",title:S,children:S},"actor")}};return a.jsxs(a.Fragment,{children:[a.jsx("tr",{className:"group hover:bg-base-200/60 transition-colors",style:{height:n?void 0:28},children:n?a.jsxs(a.Fragment,{children:[a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 font-mono text-spur-text-muted whitespace-nowrap align-middle",children:qE(e.occurredAt)}),a.jsx("td",{className:"px-3 py-1 border-b border-spur-border/40 relative align-middle min-w-0",children:a.jsxs("div",{className:"flex flex-col gap-0.5 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.jsx("button",{type:"button","aria-expanded":l,"aria-controls":`detail-${e.id}`,"aria-label":`${l?"Collapse":"Expand"} detail for ${e.eventName}`,onClick:F,onKeyDown:C,className:"inline-flex items-center justify-center w-4 h-4 text-spur-text-muted hover:text-spur-text text-[10px] transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-spur-text/40 shrink-0",children:l?"▾":"▸"}),a.jsxs("div",{className:"relative min-w-0 max-w-full flex items-center gap-1",children:[a.jsx("button",{ref:y,type:"button",className:`font-mono font-semibold truncate block max-w-full text-left cursor-pointer bg-transparent border-0 p-0 ${o}`,"data-testid":"system-event-name","aria-label":`Context for ${e.eventName}. Hover to preview; click to pin for select and copy.`,"aria-describedby":A?`system-event-tooltip-${e.id}`:void 0,onMouseEnter:()=>{N(),d(!0)},onFocus:()=>{N(),d(!0)},onBlur:M=>{!p&&!x.current?.contains(M.relatedTarget)&&d(!1)},onMouseLeave:()=>{N(),v.current=setTimeout(()=>{p||d(!1)},200)},onClick:M=>{M.preventDefault(),M.stopPropagation(),!p&&k(M.currentTarget,M.clientX,M.clientY)},onKeyDown:M=>{if(M.key==="Enter"||M.key===" "){if(M.preventDefault(),p)return;k(M.currentTarget)}},children:e.eventName}),a.jsx(qo,{value:e.eventName,label:"event name"}),!p&&$]})]}),a.jsxs("div",{className:"flex flex-col gap-0.5 text-[10px] text-spur-text-muted min-w-0",children:[a.jsx(Yc,{severity:i.severity}),a.jsx("span",{className:"truncate text-spur-text",title:ht(i.summary),children:ht(i.summary)}),a.jsx("span",{className:"truncate",title:ht(i.producer),children:ht(i.producer)}),a.jsx("span",{className:"truncate",title:ht(i.correlation),children:ht(i.correlation)}),i.agent&&a.jsxs("span",{className:"truncate font-mono",title:i.agent,children:["agent: ",i.agent]}),a.jsxs("span",{className:"truncate",children:["outcome: ",ht(i.outcome)]}),a.jsxs("span",{className:"truncate",title:ht(i.actionLabel),children:["action: ",ht(i.actionLabel)]})]})]})})]}):r.map(M=>z(M))}),l&&a.jsx("tr",{children:a.jsx("td",{colSpan:n?2:r.length,className:"px-3 py-2 border-b border-spur-border/40 bg-base-300/40",children:a.jsxs("section",{id:`detail-${e.id}`,"aria-label":`Detail for ${e.eventName}`,onKeyDown:C,tabIndex:-1,className:"flex flex-col gap-2 text-[11px] text-spur-text max-w-full",children:[a.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 font-mono text-[10px]",children:[a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"project:"})," ",ht(i.projectName)]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"root:"})," ",ht(i.projectRoot)]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"producer:"})," ",ht(i.producer)]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"correlation:"})," ",ht(i.correlation)]}),e.runId&&a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx("span",{className:"text-spur-text-muted",children:"runId:"})," ",e.runId," ",a.jsx(qo,{value:e.runId,label:"run ID"})]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"agent:"})," ",i.agent||"-"]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"actor:"})," ",S]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"prefix:"})," ",s]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"tier:"})," ",t]}),a.jsxs("span",{children:[a.jsx("span",{className:"text-spur-text-muted",children:"outcome:"})," ",ht(i.outcome)]})]}),i.fields.length>0&&a.jsx("dl",{className:"space-y-0.5",children:i.fields.map(M=>a.jsxs("div",{className:"flex gap-2",children:[a.jsxs("dt",{className:"text-spur-text-muted shrink-0",children:[M.label,":"]}),a.jsx("dd",{className:"font-mono break-all",children:ht(M.value)})]},M.label+M.value))}),a.jsxs("div",{className:"border-t border-spur-border/40 pt-1",children:[a.jsx("div",{className:"text-spur-text-muted text-[10px] mb-0.5",children:"payload (redacted):"}),a.jsx("pre",{className:"font-mono text-[10px] text-spur-text-muted overflow-x-auto whitespace-pre-wrap break-all",children:e.envelope?JSON.stringify(e.envelope,null,2):"-"})]}),a.jsx("button",{type:"button",onClick:()=>u(!1),className:"self-start text-[10px] text-spur-text-muted hover:text-error px-2 py-0.5 rounded border border-spur-border/40 hover:border-error/40 transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-spur-text/40",children:"Close (Esc)"})]})})}),p&&$&&typeof document<"u"?Or.createPortal($,document.body):null]})}function DW(e){if(!e.payload)return;if(typeof e.payload.jobId=="string")return e.payload.jobId;const n=e.payload.context?.correlation;if(typeof n?.jobId=="string")return n.jobId}function OW(e){switch(e){case"completed":return"success";case"processing":return"info";case"failed":return"error";default:return"neutral"}}function LW({job:e,onClose:t,onNavigate:n}){const[r,s]=g.useState([]),[i,o]=g.useState(null),[l,u]=g.useState(!1),c=g.useRef(0);return g.useEffect(()=>{if(!e){s([]),o(null);return}const d=m=>{m.key==="Escape"&&t()};window.addEventListener("keydown",d);const p=new AbortController,f=++c.current;return u(!0),(async()=>{try{const m=Xd({prefix:"queue",since:e.queuedAt,limit:200}),b=await Ge(new Request(m,{signal:p.signal}));if(!b.ok)throw new Error(`HTTP ${b.status}`);const x=Qd(await b.json());if(p.signal.aborted||f!==c.current)return;const y=(x?.events??[]).filter(v=>DW(v)===e.id);o(y.length);const E=y.map(v=>{const S=v.payload;return{id:v.id,eventName:v.eventName,occurredAt:v.occurredAt,error:typeof S?.error=="string"?S.error:void 0,attempt:typeof S?.attempt=="number"?S.attempt:void 0}});e.startedAt&&E.push({id:`synth-started-${e.id}`,eventName:"queue.job.started",occurredAt:e.startedAt,derived:!0}),E.sort((v,S)=>new Date(v.occurredAt).getTime()-new Date(S.occurredAt).getTime()),s(E)}catch{if(p.signal.aborted||f!==c.current)return;o(0);const m=[];e.startedAt&&m.push({id:`synth-started-${e.id}`,eventName:"queue.job.started",occurredAt:e.startedAt,derived:!0}),s(m)}finally{!p.signal.aborted&&f===c.current&&u(!1)}})(),()=>{window.removeEventListener("keydown",d),p.abort()}},[e,t]),e?a.jsx("div",{className:"fixed inset-0 z-50 flex justify-end bg-black/60 backdrop-blur-xs",onClick:t,onKeyDown:d=>{d.key==="Escape"&&t()},role:"dialog","aria-modal":"true","aria-label":`Job details for ${e.id}`,"data-testid":"job-detail-drawer",children:a.jsxs("div",{className:"w-full max-w-xl h-full bg-base-100 border-l border-base-content/10 shadow-2xl flex flex-col overflow-hidden",onClick:d=>d.stopPropagation(),onKeyDown:d=>d.stopPropagation(),role:"document",children:[a.jsxs("div",{className:"px-5 py-4 border-b border-base-content/10 flex items-center justify-between bg-base-200/50",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Lt,{variant:OW(e.status),size:"sm",children:e.status}),a.jsx("span",{className:"font-mono text-sm font-semibold text-base-content truncate max-w-xs",children:e.id})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[n&&a.jsx(Fe,{variant:"outline",size:"xs","data-testid":"navigate-system-events-btn",onClick:()=>n({tab:"system-events",runId:e.id}),children:"View in System Events"}),a.jsx(Fe,{variant:"ghost",size:"xs",onClick:t,"aria-label":"Close drawer","data-testid":"close-job-drawer",children:"✕"})]})]}),a.jsxs("div",{className:"p-5 flex-1 overflow-y-auto space-y-5",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-3 bg-base-200/40 p-3 rounded-lg border border-base-content/10 text-xs font-mono",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Type"}),a.jsx("span",{className:"font-semibold text-base-content",children:e.type})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Attempts"}),a.jsxs("span",{className:"text-base-content",children:[e.attempts," / ",e.maxRetries]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Queued At"}),a.jsx("span",{className:"text-base-content",children:new Date(e.queuedAt).toLocaleString()})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Started At"}),a.jsx("span",{className:"text-base-content",children:e.startedAt?new Date(e.startedAt).toLocaleString():"—"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Ended At"}),a.jsx("span",{className:"text-base-content",children:e.endedAt?new Date(e.endedAt).toLocaleString():"—"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-base-content/50 block text-[10px] uppercase",children:"Duration"}),a.jsx("span",{className:"text-base-content",children:e.durationMs!==null?Dv(e.durationMs):"—"})]})]}),e.lastError&&a.jsxs("div",{className:"p-3 rounded-lg bg-error/10 border border-error/20 text-error text-xs font-mono whitespace-pre-wrap break-words",children:[a.jsx("span",{className:"font-bold block mb-1",children:"Last Error:"}),e.lastError]}),a.jsxs("div",{className:"space-y-1.5",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Payload"}),a.jsx("div",{className:"bg-base-200 p-3 rounded-lg border border-base-content/10 font-mono text-xs overflow-x-auto max-h-48 text-base-content/90",children:e.payload?a.jsx("pre",{className:"whitespace-pre-wrap",children:JSON.stringify(e.payload,null,2)}):a.jsx("span",{className:"text-base-content/50 italic",children:"payload unavailable"})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Lifecycle Timeline"}),l&&a.jsx("span",{className:"text-[10px] text-base-content/50",children:"Loading…"})]}),i===0&&!l&&a.jsxs("div",{className:"p-4 rounded-lg border border-base-content/10 bg-base-200/40 text-xs text-base-content/60 italic","data-testid":"empty-lifecycle-timeline",children:["No lifecycle events recorded. Queue lifecycle events are diagnostic-tier — set"," ",a.jsx("code",{className:"font-mono text-base-content",children:"SPUR_DIAGNOSTIC_EVENTS=1"})," to capture them."]}),r.length>0&&a.jsx("div",{className:"space-y-2 font-mono text-xs","data-testid":"lifecycle-timeline-list",children:r.map(d=>a.jsxs("div",{className:"p-2.5 rounded-lg border border-base-content/10 bg-base-200/60 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[a.jsx("span",{className:"font-semibold text-base-content",children:d.eventName}),d.derived&&a.jsx(Lt,{size:"xs",variant:"outline",children:"derived"}),d.attempt!==void 0&&a.jsxs(Lt,{size:"xs",variant:"neutral",children:["attempt ",d.attempt]}),d.error&&a.jsx("span",{className:"text-error truncate max-w-xs",children:d.error})]}),a.jsx("span",{className:"text-[11px] text-base-content/50 shrink-0",children:new Date(d.occurredAt).toLocaleTimeString()})]},d.id))})]})]})]})}):null}function jW(e){switch(e){case"failed":return"failed";case"running":return"processing";case"completed":return"completed";default:return}}function MW(e){switch(e){case"completed":return"success";case"processing":return"info";case"failed":return"error";default:return"neutral"}}const FW=()=>{const[e,t]=g.useState(null),[n,r]=g.useState(null),[s,i]=g.useState(!0);return g.useEffect(()=>{const o=new AbortController;return(async()=>{try{const l=await Ge(new Request(`${nt()}/jobs/schedules`,{signal:o.signal}));if(!l.ok)throw new Error(`HTTP ${l.status}`);const u=await l.json();if(o.signal.aborted)return;t(u.schedules)}catch(l){if(o.signal.aborted)return;r(l instanceof Error?l.message:String(l))}finally{o.signal.aborted||i(!1)}})(),()=>o.abort()},[]),a.jsxs("div",{className:"p-4 rounded-xl border border-base-content/10 bg-base-200/80 shadow-xs space-y-3","data-testid":"active-schedules-card",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/70",children:"Active Schedules"}),e&&a.jsx(Lt,{size:"xs",variant:"outline",children:e.length})]}),a.jsx("span",{className:"text-[11px] text-base-content/50",children:"Recurring background cron jobs"})]}),s?a.jsx("div",{className:"text-xs text-base-content/50 py-2",children:"Loading schedules…"}):n?a.jsxs("div",{className:"text-xs text-error/80 py-1","data-testid":"schedules-error",children:["Schedules unavailable: ",n]}):!e||e.length===0?a.jsx("div",{className:"text-xs text-base-content/50 py-2 italic",children:"No active schedules registered."}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-2.5 font-mono text-xs",children:e.map(o=>a.jsxs("div",{className:"p-2.5 rounded-lg border border-base-content/10 bg-base-100 flex flex-col gap-1.5","data-testid":`schedule-item-${o.name}`,children:[a.jsxs("div",{className:"flex items-center justify-between gap-1",children:[a.jsx("span",{className:"font-semibold text-base-content truncate",children:o.name}),a.jsx(Lt,{size:"xs",variant:o.source==="builtin"?"neutral":"info",children:o.source})]}),a.jsxs("div",{className:"flex items-center justify-between text-[11px] text-base-content/60",children:[a.jsx("span",{children:o.cadence}),a.jsx("span",{className:"text-base-content/40",children:o.cron})]}),a.jsxs("div",{className:"flex items-center justify-between text-[10px] text-base-content/50 border-t border-base-content/5 pt-1 mt-0.5",children:[a.jsx("span",{children:o.nextFireAt===null?"next run: cron (unknown)":`next: ${new Date(o.nextFireAt).toLocaleTimeString()}`}),a.jsx("span",{children:o.lastStatus==="none"?"never run":o.lastStatus})]})]},o.name))})]})};function PW({timeRange:e,onNavigate:t}){const[n,r]=g.useState("all"),[s,i]=g.useState([]),[o,l]=g.useState({all:0,pending:0,processing:0,completed:0,failed:0}),[u,c]=g.useState(!1),[d,p]=g.useState(0),[f,m]=g.useState(!0),[b,x]=g.useState(null),[y,E]=g.useState(new Set),[v,S]=g.useState(null),A=g.useRef(0),N=g.useRef({timeRange:e,statusFilter:n});g.useEffect(()=>{const k=new AbortController,F=++A.current;return m(!0),x(null),(async()=>{try{const C=N.current.timeRange!==e||N.current.statusFilter!==n;C&&(N.current={timeRange:e,statusFilter:n});const $=C?0:d;C&&d!==0&&p(0);const z=Uu(e),M=new URLSearchParams,G=jW(n);G&&M.set("status",G),z&&M.set("since",z),M.set("limit","100"),M.set("offset",String($));const H=await Ge(new Request(`${nt()}/jobs?${M.toString()}`,{signal:k.signal}));if(!H.ok){const q=await H.text();throw new Error(`HTTP ${H.status}: ${q||H.statusText}`)}const j=await H.json();if(k.signal.aborted||F!==A.current)return;i($===0?j.jobs:q=>[...q,...j.jobs]),l(j.countsByStatus),c(j.hasMore),m(!1)}catch(C){if(k.signal.aborted||F!==A.current)return;x(C instanceof Error?C.message:String(C)),m(!1)}})(),()=>k.abort()},[e,n,d]);const T=(k,F)=>{F.stopPropagation(),E(C=>{const $=new Set(C);return $.has(k)?$.delete(k):$.add(k),$})},w=[{id:"all",label:"All",count:o.all},{id:"failed",label:"Failed",count:o.failed},{id:"running",label:"Running",count:o.processing},{id:"completed",label:"Completed",count:o.completed}];return a.jsxs("div",{className:"flex flex-col gap-4","data-jobs-tab":!0,"data-testid":"observability-jobs-tab",children:[a.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[a.jsx("div",{className:"flex items-center gap-1.5","data-testid":"job-status-chips",children:w.map(k=>{const F=n===k.id;return a.jsxs("button",{type:"button",onClick:()=>r(k.id),"data-testid":`status-chip-${k.id}`,className:`inline-flex items-center gap-1.5 px-3 py-1 text-xs font-semibold rounded-full transition-colors cursor-pointer ${F?k.id==="failed"?"bg-error text-error-content":"bg-neutral text-neutral-content":"bg-base-100 text-base-content/70 hover:bg-base-200 border border-base-content/10"}`,children:[a.jsx("span",{children:k.label}),a.jsx("span",{className:`px-1.5 py-0.2 text-[10px] rounded-full ${F?"bg-base-100/20":"bg-base-200 text-base-content/70"}`,children:k.count.toLocaleString()})]},k.id)})}),a.jsx(_v,{})]}),o.failed>0&&a.jsxs("div",{className:"p-3 rounded-xl bg-error/10 border border-error/20 flex items-center justify-between text-xs text-error font-medium","data-testid":"jobs-failure-banner",children:[a.jsxs("span",{children:["⚠️ ",o.failed," ",o.failed===1?"job":"jobs"," failed in this window"]}),a.jsx("button",{type:"button",className:"px-2.5 py-1 text-xs font-semibold rounded-lg border border-error text-error hover:bg-error hover:text-error-content transition-colors cursor-pointer","data-testid":"filter-to-failed-btn",onClick:()=>r("failed"),children:"Filter to Failed"})]}),a.jsx(FW,{}),a.jsxs("div",{className:"rounded-xl border border-base-content/10 bg-base-200/50 shadow-xs overflow-hidden flex flex-col",children:[a.jsxs("div",{className:"px-4 py-3 border-b border-base-content/10 bg-base-200 flex items-center justify-between flex-wrap gap-2",children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/70",children:"Queue Jobs"}),a.jsxs("span",{className:"text-xs text-base-content/50 font-mono",children:["Showing ",s.length," of ",o.all," job(s)"]})]}),b?a.jsxs("div",{className:"p-4 text-xs text-error",role:"alert","data-testid":"jobs-table-error",children:["Failed to load jobs: ",b]}):f&&s.length===0?a.jsxs("div",{className:"flex items-center justify-center h-32 text-base-content/50 text-sm",children:[a.jsx(Ss,{size:"sm"})," Loading jobs…"]}):s.length===0?a.jsx("div",{className:"p-8 text-center text-xs text-base-content/50 italic","data-testid":"jobs-empty-state",children:"No jobs found in this time range."}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-xs w-full font-mono text-xs","data-testid":"queue-jobs-table",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Job Type"}),a.jsx("th",{children:"Enqueued At"}),a.jsx("th",{children:"Started At"}),a.jsx("th",{children:"Duration"}),a.jsx("th",{children:"Attempts"}),a.jsx("th",{children:"Error"})]})}),a.jsx("tbody",{children:s.map(k=>{const F=y.has(k.id);return a.jsxs("tr",{className:"hover:bg-base-300/40 cursor-pointer transition-colors",onClick:()=>S(k),"data-testid":`job-row-${k.id}`,children:[a.jsx("td",{children:a.jsx(Lt,{size:"xs",variant:MW(k.status),children:k.status})}),a.jsx("td",{className:"font-semibold text-base-content",children:k.type}),a.jsx("td",{className:"text-base-content/60",children:new Date(k.queuedAt).toLocaleTimeString()}),a.jsx("td",{className:"text-base-content/60",children:k.startedAt?new Date(k.startedAt).toLocaleTimeString():"—"}),a.jsx("td",{className:"text-base-content/80",children:k.durationMs!==null?Dv(k.durationMs):"—"}),a.jsxs("td",{className:"text-base-content/60",children:[k.attempts," / ",k.maxRetries]}),a.jsx("td",{className:"max-w-xs",children:k.lastError?a.jsxs("div",{className:"flex flex-col gap-1",children:[a.jsx("div",{className:`text-error ${F?"whitespace-pre-wrap":"truncate"}`,"data-testid":`job-error-${k.id}`,children:k.lastError}),a.jsx("button",{type:"button",className:"text-[10px] text-base-content/60 hover:text-base-content underline self-start","data-testid":`expand-error-btn-${k.id}`,onClick:C=>T(k.id,C),children:F?"Hide":"Details"})]}):null})]},k.id)})})]})}),u&&a.jsx("div",{className:"p-3 border-t border-base-content/10 flex justify-center bg-base-200/30",children:a.jsx(Fe,{variant:"ghost",size:"xs",disabled:f,onClick:()=>p(k=>k+100),"data-testid":"jobs-load-more-btn",children:f?"Loading…":"Load more"})})]}),a.jsx(LW,{job:v,onClose:()=>S(null),onNavigate:t})]})}function YE(e){if(e===null||typeof e!="object")return null;const t=e;return typeof t.inputTokens!="number"||typeof t.outputTokens!="number"||typeof t.cacheReadTokens!="number"||typeof t.cacheCreationTokens!="number"||typeof t.records!="number"||typeof t.recordsWithUsage!="number"?null:{inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheReadTokens:t.cacheReadTokens,cacheCreationTokens:t.cacheCreationTokens,records:t.records,recordsWithUsage:t.recordsWithUsage}}function BW(e){if(e===null||typeof e!="object")return null;const t=e;return!(t.role===null||typeof t.role=="string")||typeof t.totalRuns!="number"||typeof t.matchedRuns!="number"||typeof t.unmeasured!="boolean"?null:{role:t.role,totalRuns:t.totalRuns,matchedRuns:t.matchedRuns,exact:YE(t.exact),estimated:YE(t.estimated),unmeasured:t.unmeasured}}function UW(e){if(e===null||typeof e!="object")return null;const t=e;return!(t.role===null||typeof t.role=="string")||typeof t.executor!="string"||!(t.source===null||typeof t.source=="string")||typeof t.runs!="number"||typeof t.escalations!="number"?null:{role:t.role,executor:t.executor,source:t.source,runs:t.runs,escalations:t.escalations}}function $W(e){if(e===null||typeof e!="object")return null;const t=e,n=t.routing,r=t.tokens;if(n===null||typeof n!="object"||r===null||typeof r!="object")return null;const s=n,i=r,o=s.window;if(o===null||typeof o!="object")return null;const l=o;if(typeof l.since!="string"||typeof l.until!="string"||!Array.isArray(s.pairs)||!Array.isArray(i.roles))return null;const u=[];for(const d of s.pairs){const p=UW(d);p&&u.push(p)}const c=[];for(const d of i.roles){const p=BW(d);p&&c.push(p)}return{window:{since:l.since,until:l.until},pairs:u,roles:c}}function zW(e){switch(e){case"explicit":return"pinned";case"role":return"resolved";case"default":return"default";case null:return"—";default:return e}}const HW=new Intl.NumberFormat("en-US");function Ws(e){return HW.format(e)}function KE({label:e,totals:t}){return a.jsxs("div",{"data-token-bucket":e,className:"text-xs",children:[a.jsx(Lt,{size:"xs",variant:e==="estimated"?"warning":"success",children:e}),a.jsxs("dl",{className:"grid grid-cols-2 gap-x-4 gap-y-0.5 mt-1",children:[a.jsx("dt",{className:"text-spur-text-muted",children:"input"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.inputTokens)}),a.jsx("dt",{className:"text-spur-text-muted",children:"cache read"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.cacheReadTokens)}),a.jsx("dt",{className:"text-spur-text-muted",children:"cache write"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.cacheCreationTokens)}),a.jsx("dt",{className:"text-spur-text-muted",children:"output"}),a.jsx("dd",{className:"tabular-nums text-right",children:Ws(t.outputTokens)})]})]})}function GW({role:e}){const t=e.role??"—";return a.jsxs("div",{className:"bg-base-100 border border-spur-border rounded-md p-3","data-role-attribution":t,children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-sm font-semibold text-spur-text",children:t}),a.jsxs("span",{className:"text-[10px] text-spur-text-muted tabular-nums",children:["matched ",e.matchedRuns," of ",e.totalRuns," runs"]})]}),e.unmeasured?a.jsxs("div",{className:"mt-1 text-xs","data-unmeasured":!0,children:[a.jsx(Lt,{size:"xs",variant:"ghost",children:"unmeasured"}),a.jsx("span",{className:"ml-1 text-spur-text-muted",children:"no token data recorded for this role — not a measured zero"})]}):a.jsxs("div",{className:"mt-2 flex flex-wrap gap-4",children:[e.exact?a.jsx(KE,{label:"exact",totals:e.exact}):null,e.estimated?a.jsx(KE,{label:"estimated",totals:e.estimated}):null]})]})}function WW({timeRange:e}){const[t,n]=g.useState(null),[r,s]=g.useState(null);if(g.useEffect(()=>{const o=new AbortController,l=Uu(e),u=nt(),c=l?`${u}/observability/routing-summary?since=${encodeURIComponent(l)}`:`${u}/observability/routing-summary`;return(async()=>{try{const d=await Ge(new Request(c,{signal:o.signal}));if(!d.ok)throw new Error(`routing summary fetch failed: ${d.status}`);const p=$W(await d.json());if(!p)throw new Error("routing summary response failed schema validation");n(p)}catch(d){if(o.signal.aborted)return;s(d instanceof Error?d.message:String(d))}})(),()=>o.abort()},[e]),r)return a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load routing summary: ",r]});if(t===null)return a.jsxs("div",{className:"flex items-center justify-center h-32 text-spur-text-muted text-sm",children:[a.jsx(Ss,{size:"sm"})," Loading routing summary…"]});const i=t.pairs.length===0&&t.roles.length===0;return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden","data-routing-tab":!0,children:[a.jsxs("div",{className:"px-4 py-2 border-b border-spur-border bg-base-200 shrink-0 flex items-baseline justify-between",children:[a.jsx("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:"Routing & token consumption"}),a.jsxs("span",{className:"text-[10px] text-spur-text-muted tabular-nums","data-covered-window":!0,children:["covered ",t.window.since," → ",t.window.until]})]}),i?a.jsx("div",{className:"flex-1 flex items-center justify-center p-4","data-routing-empty":!0,children:a.jsx("div",{className:"text-sm text-spur-text-muted italic",children:"No routing attribution has been recorded in the covered window — nothing to show yet."})}):a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-4",children:[t.pairs.length>0?a.jsxs("section",{className:"bg-base-100 border border-spur-border rounded-md","data-routing-table":!0,children:[a.jsxs("div",{className:"px-3 py-2 border-b border-spur-border",children:[a.jsx("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:"Role → executor"}),a.jsx("span",{className:"ml-2 text-[10px] text-spur-text-muted",children:"runs and escalations per pair; pinned and role-resolved counted separately"})]}),a.jsxs("table",{className:"table table-sm w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"text-[10px] uppercase text-spur-text-muted",children:[a.jsx("th",{children:"Role"}),a.jsx("th",{children:"Executor"}),a.jsx("th",{children:"Source"}),a.jsx("th",{className:"text-right",children:"Runs"}),a.jsx("th",{className:"text-right",children:"Escalations"})]})}),a.jsx("tbody",{children:t.pairs.map(o=>a.jsxs("tr",{children:[a.jsx("td",{className:"text-sm text-spur-text",children:o.role??"—"}),a.jsx("td",{className:"text-sm text-spur-text",children:o.executor}),a.jsx("td",{children:a.jsx(Lt,{size:"xs",variant:o.source==="explicit"?"warning":"ghost",children:zW(o.source)})}),a.jsx("td",{className:"text-right tabular-nums text-spur-text",children:Ws(o.runs)}),a.jsx("td",{className:"text-right tabular-nums text-spur-text",children:Ws(o.escalations)})]},`${o.role??""}:${o.executor}:${o.source??""}`))})]}),a.jsx("div",{className:"px-3 py-1.5 border-t border-spur-border text-[10px] text-spur-text-muted",children:"“—” role groups pure pins (no role recorded); escalations count runs that started too cheap on this executor."})]}):null,t.roles.length>0?a.jsxs("section",{"data-token-section":!0,children:[a.jsxs("div",{className:"px-1 pb-1.5",children:[a.jsx("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:"Token consumption by role"}),a.jsx("span",{className:"ml-2 text-[10px] text-spur-text-muted",children:"input, cache read, cache write, output — token totals only"})]}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:t.roles.map(o=>a.jsx(GW,{role:o},o.role??"pin"))})]}):null]})]})}const qW={system:"#38bdf8",task:"#818cf8",feature:"#a78bfa",queue:"#f59e0b",scheduler:"#10b981",rule:"#ec4899",agent:"#06b6d4",history:"#64748b"},ZE=["#38bdf8","#818cf8","#a78bfa","#f59e0b","#10b981","#ec4899","#06b6d4","#f43f5e","#64748b"];function Kc(e){const t=qW[e];if(t)return t;let n=0;for(let s=0;s<e.length;s++)n=(n<<5)-n+e.charCodeAt(s),n|=0;const r=Math.abs(n)%ZE.length;return ZE[r]??"#38bdf8"}function VW(e){return e==null||!Number.isFinite(e)?"—":(e/1e3).toFixed(2)}const YW=(e,t)=>t===void 0||t===0?null:(e-t)/Math.abs(t)*100,KW=g.memo(({current:e,previous:t,invert:n=!1})=>{if(t===void 0)return a.jsx("span",{className:"text-[10px] text-base-content/40",children:"No prior baseline"});if(t===0)return a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold font-mono bg-info/15 text-info",children:"new"});const r=YW(e,t);if(r===null)return a.jsx("span",{className:"text-[10px] text-base-content/40",children:"No prior baseline"});const s=r>=0,i=n?!s:s;return a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold font-mono ${i?"bg-emerald-500/15 text-emerald-400":"bg-error/15 text-error"}`,children:[s?"↑ +":"↓ ",Math.abs(r).toFixed(1),"% vs previous period"]})}),Vo=g.memo(({label:e,value:t,sub:n,trend:r,trendColor:s="#38bdf8",current:i,previous:o,invert:l,testId:u})=>a.jsxs("div",{className:"bg-base-200 rounded-xl shadow-xs border border-base-content/10 p-4","data-testid":u,children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:e})}),a.jsxs("div",{className:"flex items-end justify-between gap-2 mt-1",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold font-mono text-primary",children:t}),a.jsxs("div",{className:"flex items-center gap-1.5 mt-1",children:[a.jsx(KW,{current:i,previous:o,invert:l}),a.jsx("span",{className:"text-xs text-base-content/60",children:n})]})]}),r&&r.length>1?a.jsx(gv,{values:r,color:s,width:100,height:34}):null]})]}));function ZW(e){const t=g.useRef(0),[n,r]=g.useState(null),[s,i]=g.useState(null),[o,l]=g.useState(!0),[u,c]=g.useState(null),d=e.timeRange??"4h";g.useEffect(()=>{const N=++t.current,T=new AbortController;l(!0),c(null);async function w(){try{const k=Date.now(),F=Uu(d,k),C=new Date(k).toISOString();let $=`${nt()}/observability/summary`;if(F){const re=new URLSearchParams({since:F,until:C});$+=`?${re.toString()}`}const z=Ge(new Request($,{signal:T.signal}),1e4);let M=Promise.resolve(null);if(F){const re=new Date(F).getTime(),pe=k-re,I=new Date(re-pe).toISOString(),Z=F,ie=new URLSearchParams({since:I,until:Z,period:"previous"}),L=`${nt()}/observability/summary?${ie.toString()}`;M=Ge(new Request(L,{signal:T.signal}),1e4).catch(()=>null)}const[G,H]=await Promise.all([z,M]);if(N!==t.current)return;if(!G.ok){const re=await G.text();throw new Error(`HTTP ${G.status}: ${re||G.statusText}`)}const j=await G.json();let q=null;if(H?.ok)try{q=await H.json()}catch{}if(N!==t.current)return;r(j),i(q),l(!1)}catch(k){if(T.signal.aborted||N!==t.current)return;c(k instanceof Error?k.message:String(k)),l(!1)}}return w(),()=>{T.abort()}},[d]);const{series:p,chartBuckets:f}=g.useMemo(()=>{const N=n?.eventVolumeBuckets??[],T={};for(const C of N)for(const[$,z]of Object.entries(C.byPrefix))T[$]=(T[$]??0)+z;const k=Object.keys(T).sort((C,$)=>(T[$]??0)-(T[C]??0)).map(C=>({id:C,label:C,color:Kc(C)})),F=N.map(C=>({id:C.timestamp,label:Rl(C.timestamp),v:C.byPrefix}));return{series:k,chartBuckets:F}},[n?.eventVolumeBuckets]),m=g.useMemo(()=>{const N={info:0,warning:0,error:0,unknown:0};for(const w of n?.eventVolumeBuckets??[])N.info+=w.bySeverity.info,N.warning+=w.bySeverity.warning,N.error+=w.bySeverity.error,N.unknown+=w.bySeverity.unknown;const T=N.info+N.warning+N.error+N.unknown;return{counts:N,sum:T}},[n?.eventVolumeBuckets]);if(o)return a.jsxs("div",{className:"flex flex-col gap-6 animate-pulse","data-testid":"observability-summary-tab","data-summary-tab":!0,children:[a.jsx("div",{"data-testid":"observability-summary-skeleton",className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[1,2,3,4].map(N=>a.jsx("div",{className:"h-24 bg-base-200/60 rounded-xl"},N))}),a.jsx("div",{className:"h-64 bg-base-200/60 rounded-xl"})]});if(u)return a.jsx("div",{className:"p-4 rounded-lg bg-error/10 border border-error/20 text-error","data-testid":"observability-summary-error","data-summary-tab":!0,children:a.jsxs("span",{children:["Failed to load observability summary: ",u]})});const b=n?.kpis??{totalEvents:0,activeJobs:0,completedJobs:0,failedJobs:0,successRatePct:0,errorEventCount:0,warningEventCount:0},x=s?.kpis,y=n?.eventVolumeBuckets??[],E=y.map(N=>N.total),v=y.map(N=>N.bySeverity.error+N.bySeverity.warning),S=N=>{e.onNavigate?.({tab:"jobs",jobId:N})},A=(N,T)=>{e.onNavigate?.({tab:"system-events",eventName:N,runId:T})};return a.jsxs("div",{className:"flex flex-col gap-6","data-testid":"observability-summary-tab","data-summary-tab":!0,children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsx(Vo,{label:"Total Events",value:Ct(b.totalEvents),sub:"events in window",trend:E,trendColor:"#38bdf8",current:b.totalEvents,previous:x?.totalEvents,testId:"kpi-card-total-events"}),a.jsx(Vo,{label:"Active In-Flight Jobs",value:Ct(b.activeJobs),sub:"pending & processing",current:b.activeJobs,previous:x?.activeJobs,testId:"kpi-card-active-jobs"}),a.jsx(Vo,{label:"Success Rate",value:`${b.successRatePct}%`,sub:`${b.completedJobs} ok / ${b.failedJobs} fail`,current:b.successRatePct,previous:x?.successRatePct,testId:"kpi-card-success-rate"}),a.jsx(Vo,{label:"Errors & Warnings",value:`${b.errorEventCount} / ${b.warningEventCount}`,sub:"error / warning events",trend:v,trendColor:"#ef4444",current:b.errorEventCount+b.warningEventCount,previous:x?x.errorEventCount+x.warningEventCount:void 0,invert:!0,testId:"kpi-card-errors-warnings"})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-3",children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Event Volume Over Time"}),a.jsx("p",{className:"text-xs text-base-content/60 mt-0.5",children:"Distribution stacked by event prefix"})]})}),f.length>0&&p.length>0?a.jsx("div",{className:"mt-2","data-testid":"stacked-event-volume-chart",children:a.jsx(hv,{buckets:f,series:p,height:240})}):a.jsx("div",{className:"p-8 text-center text-xs text-base-content/50","data-testid":"empty-chart-fallback",children:"No event activity recorded in this time range."})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-2",children:[a.jsxs("div",{className:"flex justify-between items-center text-xs font-semibold uppercase tracking-wider text-base-content/60",children:[a.jsx("span",{children:"Severity Distribution"}),a.jsxs("span",{children:[m.sum.toLocaleString()," classified events"]})]}),a.jsx("div",{className:"w-full h-3 rounded-full bg-base-300 overflow-hidden flex","data-testid":"severity-distribution-bar",children:m.sum>0?a.jsxs(a.Fragment,{children:[m.counts.info>0&&a.jsx("div",{style:{width:`${m.counts.info/m.sum*100}%`},className:"bg-info h-full",title:`Info: ${m.counts.info}`,"data-testid":"severity-bar-info"}),m.counts.warning>0&&a.jsx("div",{style:{width:`${m.counts.warning/m.sum*100}%`},className:"bg-warning h-full",title:`Warning: ${m.counts.warning}`,"data-testid":"severity-bar-warning"}),m.counts.error>0&&a.jsx("div",{style:{width:`${m.counts.error/m.sum*100}%`},className:"bg-error h-full",title:`Error: ${m.counts.error}`,"data-testid":"severity-bar-error"}),m.counts.unknown>0&&a.jsx("div",{style:{width:`${m.counts.unknown/m.sum*100}%`},className:"bg-base-content/20 h-full",title:`Unknown: ${m.counts.unknown}`,"data-testid":"severity-bar-unknown"})]}):a.jsx("div",{className:"w-full h-full bg-base-content/10"})}),a.jsxs("div",{className:"flex flex-wrap gap-4 text-xs text-base-content/70 mt-1",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-info inline-block"})," Info:"," ",m.counts.info.toLocaleString()]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-warning inline-block"})," Warning:"," ",m.counts.warning.toLocaleString()]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-error inline-block"})," Error:"," ",m.counts.error.toLocaleString()]}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-base-content/20 inline-block"})," Unknown:"," ",m.counts.unknown.toLocaleString()]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-3",children:[a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Top Event Types"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"table table-xs w-full font-mono text-xs","data-testid":"top-event-types-table",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-base-content/10 text-base-content/60",children:[a.jsx("th",{children:"Event Name"}),a.jsx("th",{children:"Prefix"}),a.jsx("th",{className:"text-right",children:"Count"}),a.jsx("th",{className:"text-right",title:"Average duration in seconds",children:"Avg(Duration - s)"}),a.jsx("th",{className:"text-right",title:"Events with error severity",children:"Failures"}),a.jsx("th",{className:"text-right",children:"Latest"})]})}),a.jsxs("tbody",{children:[(n?.topEventTypes??[]).map(N=>a.jsxs("tr",{className:"hover:bg-base-300/40",children:[a.jsx("td",{className:"font-semibold text-base-content",children:N.name}),a.jsx("td",{children:a.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] font-bold border",style:{color:Kc(N.prefix),borderColor:Kc(N.prefix)},children:N.prefix})}),a.jsx("td",{className:"text-right text-base-content/80 tabular-nums",children:N.count.toLocaleString()}),a.jsx("td",{className:"text-right text-base-content/80 tabular-nums","data-testid":`top-event-avg-${N.name}`,children:VW(N.avgDurationMs)}),a.jsx("td",{className:`text-right tabular-nums ${N.failureCount>0?"text-error font-semibold":"text-base-content/80"}`,"data-testid":`top-event-failures-${N.name}`,children:N.failureCount.toLocaleString()}),a.jsx("td",{className:"text-right text-base-content/50",children:new Date(N.latestAt).toLocaleTimeString()})]},N.name)),(!n||(n.topEventTypes??[]).length===0)&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,className:"text-center text-base-content/40 py-4",children:"No events recorded"})})]})]})})]}),a.jsxs("div",{className:"bg-base-200 rounded-xl border border-base-content/10 p-4 flex flex-col gap-3",children:[a.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-base-content/60",children:"Recent Failures"}),a.jsxs("div",{className:"flex flex-col gap-2 max-h-[320px] overflow-y-auto","data-testid":"recent-failures-feed",children:[(n?.recentErrors??[]).map(N=>{const T=!!e.onNavigate,w=()=>{N.source==="job"?S(N.id):A(N.name,N.refId)},k=a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Lt,{size:"xs",variant:N.source==="job"?"warning":"error",children:N.source}),a.jsx("span",{className:"font-mono text-xs font-semibold text-base-content",children:N.name})]}),a.jsx("span",{className:"text-[11px] text-base-content/50 font-mono",children:new Date(N.occurredAt).toLocaleTimeString()})]}),a.jsx("p",{className:"text-xs text-error font-mono truncate",children:N.message})]});return T?a.jsx("button",{type:"button",className:"w-full text-left p-2.5 rounded-lg border border-base-content/10 bg-base-100 flex flex-col gap-1 transition-colors hover:bg-base-200/80 cursor-pointer",onClick:w,"data-testid":`failure-row-${N.source}-${N.id}`,children:k},`${N.source}-${N.id}-${N.occurredAt}`):a.jsx("div",{className:"p-2.5 rounded-lg border border-base-content/10 bg-base-100 flex flex-col gap-1","data-testid":`failure-row-${N.source}-${N.id}`,children:k},`${N.source}-${N.id}-${N.occurredAt}`)}),(!n||(n.recentErrors??[]).length===0)&&a.jsx("div",{className:"p-8 text-center text-xs text-base-content/50",children:"No recent failures in this time range."})]})]})]})]})}const Zc=[{id:"summary",label:"Summary",component:ZW},{id:"system-events",label:"System Events",component:_W},{id:"jobs",label:"Jobs",component:PW},{id:"routing",label:"Routing",component:WW}];function XW(){const[e,t]=g.useState(Zc[0]?.id??""),[n,r]=g.useState("4h"),[s,i]=g.useState({status:"connecting",rate:0,lastEventAt:null}),l=Zc.find(b=>b.id===e)?.component,u=g.useCallback(b=>{i(b)},[]),c=g.useCallback(b=>{t(b.tab)},[]),d=e==="system-events",p=d?s.status:"idle",f=d?s.status==="live"?`live tail · ${s.rate} evt/60s`:s.status==="connecting"?"connecting…":s.status==="paused"?"live tail paused":"stream error":"live tail idle",m=p==="live"?"bg-emerald-400 animate-pulse":p==="connecting"?"bg-amber-400":p==="errored"?"bg-error":"bg-base-content/40";return a.jsxs("div",{className:"flex flex-col gap-4 p-4 max-w-[1600px] mx-auto w-full","data-observability-shell":!0,children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-base-content/10 pb-3 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl",children:"📡"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight",children:"Observabilities"}),a.jsx("p",{className:"text-xs text-base-content/60",children:"System event streams, queue execution telemetry, and routing attribution"}),a.jsxs("p",{className:"livechip mt-1 inline-flex items-center gap-1.5 rounded-full border border-base-content/10 px-2 py-0.5 text-xs text-base-content/60 font-mono","data-testid":"observability-liveness-chip",role:"status","aria-live":"polite",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${m}`,"aria-hidden":"true"}),f,d&&s.lastEventAt&&a.jsxs(a.Fragment,{children:[" · last ",a.jsx("time",{dateTime:s.lastEventAt,children:new Date(s.lastEventAt).toLocaleTimeString()})]})]})]})]}),a.jsx(oW,{timeRange:n,onTimeRangeChange:r}),a.jsx("div",{role:"tablist","aria-label":"Observability tabs",className:"flex items-center gap-1 bg-base-300 p-1 rounded-xl",children:Zc.map(b=>{const x=b.id===e;return a.jsx("button",{type:"button",role:"tab","aria-selected":x,"aria-controls":`observability-tab-panel-${b.id}`,id:`observability-tab-${b.id}`,onClick:()=>t(b.id),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer ${x?"bg-primary text-primary-content font-bold shadow-sm":"text-base-content/70 hover:bg-base-content/10"}`,children:b.label},b.id)})})]}),a.jsx("div",{role:"tabpanel",id:`observability-tab-panel-${e}`,"aria-labelledby":`observability-tab-${e}`,className:"mt-2 flex flex-col gap-4",children:l?a.jsx(l,{onLivenessChange:u,timeRange:n,onNavigate:c}):null})]})}const QW={id:"observability",name:"Observabilities",icon:"📡",route:"observability",component:XW,sidebarLabel:"Observabilities",description:"Real-time system events, execution traces, and agent doctor telemetry",order:10},JW=Object.freeze(Object.defineProperty({__proto__:null,module:QW},Symbol.toStringTag,{value:"Module"})),Ov=()=>`${nt()}/project/plans`;async function eq(e){const t=await Ge(new Request(Ov(),{signal:e}));if(!t.ok)throw new Error(`plan files fetch failed: ${t.status}`);const n=await t.json();if(!Array.isArray(n.files))throw new Error("plan files: invalid response shape");return n.files}async function tq(e,t){const n=`${Ov()}/file?path=${encodeURIComponent(e)}`,r=await Ge(new Request(n,{signal:t}));if(!r.ok)throw new Error(`plan file fetch failed: ${r.status}`);const s=await r.json();if(!s.ok||typeof s.content!="string")throw new Error("plan file: invalid response shape");return s}function nq({files:e,selectedPath:t,onSelect:n}){const[r,s]=g.useState(""),i=g.useMemo(()=>{if(!r.trim())return e;const u=r.toLowerCase();return e.filter(c=>c.name.toLowerCase().includes(u)||c.title.toLowerCase().includes(u)||c.path.toLowerCase().includes(u))},[e,r]),o=g.useMemo(()=>i.filter(u=>u.category==="roadmap"),[i]),l=g.useMemo(()=>i.filter(u=>u.category==="plan"),[i]);return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden","data-testid":"plan-file-list",children:[a.jsx("div",{className:"p-2 border-b border-spur-border bg-base-100/50 shrink-0",children:a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:"text",value:r,onChange:u=>s(u.target.value),placeholder:"Filter plans...",className:"w-full text-xs px-2.5 py-1.5 pl-7 rounded border border-spur-border bg-base-100 text-spur-text placeholder:text-spur-text-muted/60 focus:outline-none focus:border-spur-accent","aria-label":"Filter plan documents"}),a.jsx("span",{className:"absolute left-2 top-1.5 text-xs text-spur-text-muted pointer-events-none",children:"🔍"}),r&&a.jsx("button",{type:"button",onClick:()=>s(""),className:"absolute right-2 top-1 text-xs text-spur-text-muted hover:text-spur-text p-0.5","aria-label":"Clear filter",children:"✕"})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-3",children:i.length===0?a.jsx("div",{className:"p-4 text-xs text-spur-text-muted italic text-center",children:r?`No documents match "${r}"`:"No plan documents found."}):a.jsxs(a.Fragment,{children:[o.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] font-bold uppercase tracking-wider text-spur-text-muted flex items-center justify-between",children:[a.jsx("span",{children:"Core Roadmap"}),a.jsx("span",{className:"text-[10px] font-mono",children:o.length})]}),a.jsx("div",{className:"space-y-0.5 mt-1",children:o.map(u=>{const c=t===u.path;return a.jsxs("button",{type:"button",onClick:()=>n(u.path),title:u.name,className:`w-full text-left px-2.5 py-1.5 rounded-md transition-colors flex items-center gap-2 cursor-pointer ${c?"bg-spur-accent/15 text-spur-accent font-semibold shadow-xs":"hover:bg-base-300 text-spur-text hover:text-spur-text"}`,children:[a.jsx("span",{className:"text-sm shrink-0",children:"🧭"}),a.jsx("span",{className:"flex-1 min-w-0 text-xs truncate font-medium",title:u.name,children:u.title})]},u.id)})})]}),l.length>0&&a.jsxs("div",{children:[a.jsxs("div",{className:"px-2 py-1 text-[11px] font-bold uppercase tracking-wider text-spur-text-muted flex items-center justify-between",children:[a.jsx("span",{children:"Execution Plans"}),a.jsx("span",{className:"text-[10px] font-mono",children:l.length})]}),a.jsx("div",{className:"space-y-0.5 mt-1",children:l.map(u=>{const c=t===u.path;return a.jsxs("button",{type:"button",onClick:()=>n(u.path),title:u.name,className:`w-full text-left px-2.5 py-1.5 rounded-md transition-colors flex items-center gap-2 cursor-pointer ${c?"bg-spur-accent/15 text-spur-accent font-semibold shadow-xs":"hover:bg-base-300 text-spur-text hover:text-spur-text"}`,children:[a.jsx("span",{className:"text-xs shrink-0 text-spur-text-muted",children:"📄"}),a.jsx("span",{className:"flex-1 min-w-0 text-xs truncate",title:u.name,children:u.title})]},u.id)})})]})]})})]})}function rq(e){if(!e)return[];const t=e.split(/\r?\n/),n=[],r=new Map;let s=!1;for(const i of t){if(i.trim().startsWith("```")){s=!s;continue}if(s)continue;const l=i.match(/^(#{1,6})\s+(.+)$/);if(l?.[1]&&l[2]){const u=l[1].length,d=l[2].trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=d.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||`heading-${n.length+1}`,m=r.get(f)??0;r.set(f,m+1);const b=m===0?f:`${f}-${m}`;n.push({id:b,text:d,level:u})}}return n}function sq(){const e=new Map;return{nextId(t){const r=t.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-")||"heading",s=e.get(r)??0;return e.set(r,s+1),s===0?r:`${r}-${s}`}}}function aq({markdown:e,scrollContainerRef:t,onClose:n}){const r=g.useMemo(()=>rq(e),[e]),[s,i]=g.useState(null);g.useEffect(()=>{const l=t?.current;if(!l||r.length===0)return;const u=()=>{const c=l.getBoundingClientRect().top;let d=null;for(const p of r){const f=document.getElementById(p.id);f&&f.getBoundingClientRect().top-c<=100&&(d=p.id)}d&&i(d)};return l.addEventListener("scroll",u,{passive:!0}),u(),()=>l.removeEventListener("scroll",u)},[r,t]);const o=l=>{i(l);const u=document.getElementById(l);u&&u.scrollIntoView({behavior:"smooth",block:"start"})};return a.jsxs("aside",{id:"plan-toc-dock","aria-label":"Table of Contents",className:"w-64 lg:w-72 shrink-0 rounded-lg border border-spur-border bg-base-200 shadow-xs flex flex-col overflow-hidden 3xl:absolute 3xl:top-0 3xl:bottom-0 3xl:left-[calc(100%_+_12px)] 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl","data-testid":"plan-toc-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"📑"})," Table of Contents"]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[r.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:r.length}),n&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent h-5 w-5 p-0 text-xs flex items-center justify-center cursor-pointer",onClick:n,"aria-label":"Close table of contents",title:"Close table of contents",children:"✕"})]})]}),a.jsx("div",{className:"flex-1 overflow-y-auto p-1.5 space-y-0.5",children:r.length===0?a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No headings in document."}):r.map(l=>{const u=s===l.id;let c="pl-2 text-xs font-semibold";return l.level===2?c="pl-4 text-xs font-medium":l.level===3?c="pl-6 text-xs text-spur-text-muted":l.level>=4&&(c="pl-8 text-[11px] text-spur-text-muted"),a.jsx("button",{type:"button",onClick:()=>o(l.id),title:l.text,className:`w-full text-left py-1 pr-2 rounded transition-colors truncate block cursor-pointer ${c} ${u?"bg-spur-accent/15 text-spur-accent font-semibold":"hover:bg-base-300 hover:text-spur-text text-spur-text/80"}`,children:l.text},l.id)})})]})}function iq({source:e,className:t}){const n=Qb(e),r=sq(),s=o=>{const l=`h${o}`;return({children:u,...c})=>{const p=Oi(u).trim().replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*]+)\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/\[([^\]]+)\]\([^)]+\)/g,"$1").trim(),f=r.nextId(p);return a.jsx(l,{id:f,className:"scroll-mt-6 group",...c,children:u})}},i={code:Jb,h1:s(1),h2:s(2),h3:s(3),h4:s(4),h5:s(5),h6:s(6)};return a.jsx("div",{className:`plan-markdown-container ${t??""}`,"data-testid":"plan-markdown-body",children:a.jsx(ia.Markdown,{source:n,wrapperElement:{"data-color-mode":"light"},components:i})})}function oq(){const[e,t]=ap(),[n,r]=g.useState(null),[s,i]=g.useState(()=>e.get("file")),o=g.useRef({}),[l,u]=g.useState({}),[c,d]=g.useState(!0),[p,f]=g.useState(!0),[m,b]=g.useState(!1),[x,y]=g.useState(!0),[E,v]=g.useState(!1),[S,A]=g.useState(null),[N,T]=g.useState(null),[w,k]=g.useState(!1),F=g.useRef(null),C=g.useRef(null),$=g.useCallback(async I=>{try{y(!0);const Z=await eq(I);return r(Z),A(null),Z}catch(Z){return I?.aborted||A(Z instanceof Error?Z.message:String(Z)),null}finally{y(!1)}},[]),z=g.useCallback(async(I,Z)=>{if(!o.current[I])try{v(!0),T(null);const ie=await tq(I,Z);o.current[I]=ie,u(L=>({...L,[I]:ie}))}catch(ie){if(Z?.aborted)return;T(ie instanceof Error?ie.message:String(ie))}finally{v(!1)}},[]),M=e.get("file");g.useEffect(()=>{const I=new AbortController;return(async()=>{const Z=await $(I.signal);if(Z&&Z.length>0){if(M&&Z.some(L=>L.path===M))i(M);else if(!M){const L=Z[0]?.path;L&&i(L)}}})(),()=>I.abort()},[$,M]),g.useEffect(()=>{M&&M!==s&&i(M)},[M,s]),g.useEffect(()=>{if(!s)return;const I=new AbortController;return z(s,I.signal),()=>I.abort()},[s,z]);const G=I=>{i(I),f(!0),t({file:I},{replace:!0}),F.current&&(F.current.scrollTop=0)},H=()=>{s&&(navigator.clipboard.writeText(s),k(!0),setTimeout(()=>k(!1),2e3))},j=s?l[s]:null,{frontmatterRaw:q,frontmatter:re,body:pe}=g.useMemo(()=>j?.content?Kw(j.content):{frontmatterRaw:null,frontmatter:null,body:""},[j?.content]);return S?a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert",children:["Failed to load plan documents: ",S]}):x&&n===null?a.jsx("div",{className:"flex items-center justify-center h-full text-spur-text-muted text-sm",children:"Loading plan documents…"}):a.jsxs("div",{className:"relative h-full w-full p-4 overflow-hidden","data-plans-shell":!0,children:[a.jsxs("div",{className:"flex flex-col h-full w-full max-w-full 3xl:max-w-[1200px] 4xl:max-w-[1600px] mx-auto gap-3","data-plans-workspace":!0,children:[a.jsxs("header",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-spur-border pb-3 shrink-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:"🧭"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight text-spur-text",children:"Plans"}),a.jsx("p",{className:"text-xs text-spur-text-muted",children:"Project roadmap, release commitments, and execution proposals"})]})]}),a.jsxs("div",{className:"flex items-center gap-1","data-plans-actions":!0,children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>d(I=>!I),"aria-label":c?"Collapse plan file list":"Expand plan file list","aria-expanded":c,"aria-controls":"plan-files-dock",title:c?"Collapse plan file list":"Expand plan file list",children:c?"◧":"▶"}),s&&j?.content&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>f(I=>!I),"aria-label":p?"Collapse table of contents":"Expand table of contents","aria-expanded":p,"aria-controls":"plan-toc-dock",title:p?"Collapse table of contents":"Expand table of contents",children:p?"📑":"📖"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent",onClick:()=>{(async()=>(await $(),s&&(u(I=>{const Z={...I};return delete Z[s],Z}),z(s))))()},"aria-label":"Refresh plan documents",title:"Refresh plan documents",children:"🔄"})]})]}),a.jsxs("div",{className:"flex-1 min-h-0 flex items-stretch gap-3 overflow-hidden 3xl:relative 3xl:block 3xl:overflow-visible",ref:C,children:[a.jsxs("div",{id:"plan-files-dock",hidden:!c,className:`${c?"flex":"hidden"} w-64 lg:w-72 shrink-0 flex-col overflow-hidden rounded-lg border border-spur-border bg-base-200 shadow-xs 3xl:absolute 3xl:right-[calc(100%_+_12px)] 3xl:top-0 3xl:bottom-0 3xl:z-20 3xl:w-72 4xl:w-80 3xl:shadow-xl`,"data-testid":"plan-files-dock",children:[a.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-spur-border bg-base-300/60 shrink-0",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text flex items-center gap-1.5",children:[a.jsx("span",{children:"🧭"})," Plan Docs"]}),n&&n.length>0&&a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-accent/15 text-spur-accent font-semibold",children:n.length})]}),a.jsx("div",{className:"flex-1 overflow-hidden",children:n&&n.length>0?a.jsx(nq,{files:n,selectedPath:s,onSelect:G}):a.jsx("div",{className:"p-3 text-xs text-spur-text-muted italic",children:"No plan documents found."})})]}),a.jsx("div",{className:"flex-1 min-w-0 h-full overflow-hidden rounded-lg border border-spur-border bg-base-100 relative 3xl:w-full 3xl:flex-none","data-testid":"plan-workspace",children:a.jsx("div",{className:"w-full h-full overflow-y-auto",ref:F,children:s?a.jsxs("div",{className:"flex flex-col min-h-full",children:[a.jsxs("div",{className:"sticky top-0 z-10 flex items-center justify-between px-6 py-3 border-b border-spur-border bg-base-100/90 backdrop-blur-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[a.jsx("span",{className:"text-xs font-mono px-2 py-0.5 rounded bg-base-200 text-spur-text-muted border border-spur-border shrink-0",children:s}),j?.title&&a.jsx("h2",{className:"text-sm font-semibold text-spur-text truncate",children:j.title})]}),a.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-accent flex items-center gap-1 shrink-0",onClick:()=>b(!0),"aria-label":"View document metadata",title:"View document metadata","data-testid":"metadata-toggle",children:"ℹ Metadata"}),a.jsx(Fe,{variant:"ghost",size:"xs",className:"text-spur-text-muted hover:text-spur-text shrink-0",onClick:H,"aria-label":"Copy file path",title:"Copy file path",children:w?"✓ Copied":"📋 Copy Path"})]})]}),a.jsx("div",{className:"p-6 md:p-8 flex-1","data-testid":"plan-body-container",children:E&&!j?a.jsx("div",{className:"flex items-center justify-center py-20 text-spur-text-muted text-sm",children:"Loading document content…"}):N?a.jsxs("div",{className:"p-4 text-sm text-error bg-error/10 rounded-md border border-error/20",children:["Failed to load document: ",N]}):j?a.jsx(iq,{source:pe}):null})]}):a.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-spur-text-muted gap-2",children:[a.jsx("span",{className:"text-3xl","aria-hidden":"true",children:"🧭"}),a.jsx("span",{className:"text-sm font-medium",children:"Select a plan document to view"})]})})}),s&&j?.content&&p&&a.jsx(aq,{markdown:pe,scrollContainerRef:F,onClose:()=>f(!1)})]})]}),a.jsx(lw,{open:m,onClose:()=>b(!1),title:j?.title,filePath:s,frontmatterRaw:q,frontmatter:re})]})}const lq={id:"plans",name:"Plans",icon:"🧭",route:"plans",component:oq,sidebarLabel:"Plans",description:"Project roadmap, release commitments, and execution proposals",order:24},uq=Object.freeze(Object.defineProperty({__proto__:null,module:lq},Symbol.toStringTag,{value:"Module"})),$u="board-operator",Jd="SPUR-REQUEST/1 ";function Xc(e,t){return e.kind==="task"&&t.kind==="task"?e.wbs===t.wbs:e.kind==="feature"&&t.kind==="feature"?e.id===t.id:!1}function cq(e,t){return t.length===0?e:`${Jd}${JSON.stringify({refs:t.map(dq)})}
|
|
311
311
|
|
|
312
312
|
${e}`}function dq(e){return e.kind==="task"?{kind:"task",wbs:e.wbs}:{kind:"feature",id:e.id}}function pq(e){if(e===null||typeof e!="object")return!1;const t=e;return t.kind==="task"?typeof t.wbs=="string"&&t.wbs.length>0:t.kind==="feature"?typeof t.id=="string"&&t.id.length>0:!1}function fq(e){if(!e.startsWith(Jd))return{text:e,refs:[]};const t=e.slice(Jd.length),n=/\r?\n\r?\n/.exec(t),r=n===null?t:t.slice(0,n.index),s=n===null?"":t.slice(n.index+n[0].length);let i;try{i=JSON.parse(r)}catch{return{text:e,refs:[]}}if(i===null||typeof i!="object"||Array.isArray(i))return{text:e,refs:[]};const o=i.refs;return Array.isArray(o)?{text:s,refs:o.filter(pq)}:{text:e,refs:[]}}function Lv(e){if(e===null||typeof e!="object"||!("messages"in e))return[];const t=e.messages;if(!Array.isArray(t))return[];const n=[];for(const r of t){if(r===null||typeof r!="object")continue;const s=r;typeof s.id!="string"||typeof s.toId!="string"||typeof s.body!="string"||typeof s.status!="string"||typeof s.createdAt!="string"||n.push({id:s.id,fromId:typeof s.fromId=="string"?s.fromId:null,toId:s.toId,body:s.body,status:s.status,createdAt:s.createdAt,inReplyTo:typeof s.inReplyTo=="string"?s.inReplyTo:null})}return n}function mq(e,t){const n=e.filter(s=>s.fromId===$u).map(s=>XE(s,"request")),r=t.map(s=>XE(s,"response"));return[...n,...r].sort((s,i)=>s.createdAt===i.createdAt?s.id<i.id?-1:s.id>i.id?1:0:s.createdAt<i.createdAt?-1:1)}function XE(e,t){const n=fq(e.body);return{id:e.id,kind:t,fromId:e.fromId,toId:e.toId,text:n.text,refs:n.refs,createdAt:e.createdAt,inReplyTo:e.inReplyTo,deliveryStatus:e.status}}const jv={pending:{icon:"◐",label:"pending",meaning:"Receipt captured; waiting for durable acceptance. The submitted revision clears only on acceptance.",action:"wait — the request is being persisted",tone:"warn"},"queued-awaiting-orchestrator":{icon:"⏸",label:"queued-awaiting-orchestrator",meaning:"Durable receipt exists but no active orchestrator has consumed it. NOT “working”. ",action:"bind/restore an orchestrator (Agents → Planner · Scout)",tone:"warn"},"orchestrator-missing":{icon:"⏸",label:"orchestrator-missing",meaning:"No orchestrator instance is bound, so the durable request cannot be consumed.",action:"bind/restore an orchestrator (Agents → Planner · Scout)",tone:"warn"},"orchestrator-offline":{icon:"⏸",label:"orchestrator-offline",meaning:"The orchestrator’s claim is held but stale — it is not consuming the queue.",action:"start the orchestrator member (Agents tab)",tone:"warn"},"executor-unavailable":{icon:"⊘",label:"executor-unavailable",meaning:"No executor tier can serve the addressed member, so the request was not accepted; the draft is preserved.",action:"fix the member’s executor binding, then retry — same payload, same requestId",tone:"err"},"rest-held":{icon:"⏳",label:"rest-held",meaning:"Rest accepted the request into a visible hold.",action:"release from rest (Agents) or let rest wake it; results from already-running work keep arriving",tone:"warn"},blocked:{icon:"⛔",label:"blocked",meaning:"The strategy is holding the task on a first-class condition (unauthorized, not-ready, unmet-dependency, no idle instance).",action:"inspect Activity for the pending signal, then unblock",tone:"warn"},"accepted-working":{icon:"▶",label:"accepted · executor working",meaning:"Durable acceptance; an executor is working. This is occupancy, NOT a verified result.",action:"wait for the run receipt",tone:"ok"},"failed-delivery":{icon:"✕",label:"failed-delivery",meaning:"The run could not accept this payload; the draft is preserved.",action:"Retry keeps the SAME requestId for this immutable payload; editing text first creates a NEW requestId",tone:"err"},"outcome-unknown":{icon:"?",label:"outcome-unknown",meaning:"The run consumed the request without ever reporting a receipt.",action:"inspect Messages/Activity and reconcile before any resend — a blind retry would duplicate the payload",tone:"err"},"completed-exit-only":{icon:"✓",label:"run exit 0 recorded (unverified)",meaning:"A process exit code is not proof of success (run exit ≠ verified result).",action:"reconcile in Messages/Activity; only then mark the result verified",tone:"warn"},"completed-verified":{icon:"✓",label:"completed · verified result",meaning:"Result received and reconciled against the original request.",action:"none — this request is finished",tone:"ok"}};function Mv(e,t,n){if(n&&e===null)return"pending";const r=e?.deliveryStatus??"queued",s=e?.reason??null,i=e?.outcome??null,o=e?.hold??null;if(r==="failed")return"failed-delivery";if(s==="outcome-unknown")return"outcome-unknown";if(s==="attempts-exhausted")return"failed-delivery";if(i==="verified")return"completed-verified";if(i==="run-exit-only")return"completed-exit-only";if(i==="errored")return"failed-delivery";if(o==="rest-after-drain")return"rest-held";if(o==="executor-unavailable")return"executor-unavailable";if(o!==null)return"blocked";if(r==="injected"||r==="delivered")return"accepted-working";const l=t?.orchestrator.state??null;if(r==="queued"&&(l==="missing"||l==="unresolvable"))return"orchestrator-missing";if(r==="queued"&&l==="bound-offline")return"orchestrator-offline";const u=t?.orchestrator.instanceId,c=t!==null&&u!==void 0?t.members.find(d=>d.instanceId===u):void 0;return r==="queued"&&c!==void 0&&(c.enabled===!1||c.capabilityState==="unavailable")?"executor-unavailable":r==="queued"&&t?.strategy?.name==="rest"?"rest-held":"queued-awaiting-orchestrator"}const Fv={path:null,name:"",fleet:null,state:"loading"},Pv=g.createContext(Fv);function hq({children:e}){const[t,n]=g.useState(Fv);return g.useEffect(()=>{const r=new AbortController;let s=!1;return Ge(new Request(`${nt()}/project`,{signal:r.signal})).then(async i=>i.ok?await i.json():null).then(i=>{if(s)return;if(!i?.path){n({path:null,name:"",fleet:null,state:"unresolvable"});return}const o=i.path;n(l=>({...l,path:o,name:i.name??"",state:"ready"}))}).catch(()=>{s||n({path:null,name:"",fleet:null,state:"unresolvable"})}),Ge(new Request(`${nt()}/project/fleet`,{signal:r.signal})).then(async i=>i.ok?await i.json():null).then(i=>{s||i===null||n(o=>({...o,fleet:i}))}).catch(()=>{}),()=>{s=!0,r.abort()}},[]),a.jsx(Pv.Provider,{value:t,children:e})}function _a(){return g.useContext(Pv)}const gq=15e3;function bq(e){if(e===null||typeof e!="object")return null;const t=e;return typeof t.messageId!="string"||t.messageId.length===0||typeof t.deliveryStatus!="string"||typeof t.injectAttempts!="number"?null:{messageId:t.messageId,requestKey:typeof t.requestKey=="string"?t.requestKey:null,deliveryStatus:t.deliveryStatus,injectAttempts:t.injectAttempts,injectError:typeof t.injectError=="string"?t.injectError:null,runId:typeof t.runId=="string"?t.runId:null,taskId:typeof t.taskId=="string"?t.taskId:null,outcome:t.outcome==="run-exit-only"||t.outcome==="errored"||t.outcome==="verified"?t.outcome:null,reason:typeof t.reason=="string"?t.reason:null,hold:typeof t.hold=="string"?t.hold:null}}function Bv(e,t=gq){const[n,r]=g.useState(()=>new Map),[s,i]=g.useState(!1);return g.useEffect(()=>{if(e==null){r(new Map),i(!1);return}const o=new AbortController;let l=!1;const u=`${nt()}/project/requests`,c=()=>{Ge(new Request(u,{signal:o.signal})).then(async p=>{if(!p.ok)throw new Error(`requests fetch failed: ${p.status}`);const m=(await p.json()).requests,b=Array.isArray(m)?m.map(bq).filter(x=>x!==null):[];l||(r(new Map(b.map(x=>[x.messageId,x]))),i(!1))}).catch(()=>{l||i(!0)})};c();const d=setInterval(c,t);return()=>{l=!0,clearInterval(d),o.abort()}},[e,t]),{requests:n,failed:s}}function xq(e){return`${nt()}/messages/inbox?agent=${encodeURIComponent(e)}`}function yq(){const e=_a(),[t,n]=g.useState(null),[r,s]=g.useState(!1),i=e.fleet?.orchestrator.instanceId??null,{requests:o,failed:l}=Bv(i),u=t?.map(c=>{const d=o.get(c.id);return d===void 0?c:{...c,requestKey:d.requestKey??void 0,receipt:d}})??null;return g.useEffect(()=>{if(e.path===null)return;const c=new AbortController;let d=!1;const p=async m=>{const b=await Ge(new Request(xq(m),{signal:c.signal}));if(!b.ok)throw new Error(`inbox fetch failed: ${b.status}`);return Lv(await b.json())},f=i!==null?p(i):Promise.resolve([]);return Promise.all([f,p($u)]).then(([m,b])=>{d||(n(mq(m,b)),s(!1))}).catch(()=>{d||s(!0)}),()=>{d=!0,c.abort()}},[e.path,i]),a.jsx("div",{className:"flex flex-col h-full overflow-hidden bg-spur-bg","data-conversation-view":!0,children:a.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-1","data-conversation-thread":!0,children:[t===null&&!r&&a.jsx("div",{className:"p-4 text-sm text-spur-text-muted italic","data-conversation-loading":!0,children:"Loading conversation…"}),r&&a.jsx("div",{className:"p-4 text-sm text-spur-text-muted","data-conversation-fetch-failed":!0,role:"alert",children:"Conversation unavailable — the message feed could not be read."}),l&&!r&&a.jsx("div",{className:"p-4 text-xs text-spur-text-muted","data-conversation-requests-failed":!0,role:"status",children:"Results feed unavailable — receipt states may be stale."}),t!==null&&t.length===0&&a.jsx("div",{className:"p-4 text-sm text-spur-text-muted italic","data-conversation-empty":!0,children:"No messages yet for this project."}),u?.map(c=>a.jsx(Sq,{entry:c},c.id))]})})}function Eq(e){return e.kind==="task"?`task:${e.wbs}`:`feature:${e.id}`}function Sq({entry:e}){const t=e.receipt,n=Mv(t??null,null,!1),r=jv[n];return a.jsxs("div",{className:"p-2 bg-spur-surface-2 border border-spur-border rounded-xl text-sm","data-conversation-entry":!0,"data-conversation-kind":e.kind,children:[a.jsxs("div",{className:"flex items-center gap-2 text-spur-text-muted text-xs",children:[a.jsx("span",{className:"font-medium text-spur-text",children:e.kind==="request"?"Request":"Response"}),a.jsxs("span",{className:"font-mono truncate","data-conversation-route":!0,children:[e.fromId??"system"," → ",e.toId]}),a.jsx("span",{className:"text-xs px-1 rounded bg-spur-surface-3 text-spur-text","data-conversation-delivery":!0,children:e.deliveryStatus}),e.kind==="request"&&a.jsxs("span",{className:"text-xs px-1 rounded font-medium","data-conversation-receipt-state":n,title:`${r.meaning} Next: ${r.action}`,children:[a.jsx("span",{"aria-hidden":"true",children:r.icon})," ",r.label]}),e.inReplyTo!==null&&a.jsxs("span",{className:"font-mono text-xs opacity-70","data-conversation-reply-to":!0,children:["↩ ",e.inReplyTo]}),a.jsx("span",{className:"ml-auto font-mono text-xs text-spur-text-muted",children:e.createdAt})]}),e.refs.length>0&&a.jsx("div",{className:"flex flex-wrap gap-1 mt-1","data-conversation-entry-refs":!0,children:e.refs.map(s=>a.jsx("span",{className:"text-xs px-1 rounded bg-info/20 text-info font-mono","data-conversation-ref":s.kind,children:s.kind==="task"?`task ${s.wbs}`:`feature ${s.id}`},Eq(s)))}),a.jsx("p",{className:"text-spur-text mt-1 whitespace-pre-wrap break-words",children:e.text})]})}const Yo=1e3,Qc=[1e3,2e3,4e3,8e3,15e3],Tq=15e3;function Nq(e){if(e===null||typeof e!="object")return null;const t=e;if(typeof t.stream!="string"||typeof t.ts!="string"||typeof t.line!="string")return null;const n=t.stream;if(n!=="stdout"&&n!=="stderr"&&n!=="meta")return null;const r=t.seq;return r!==void 0&&typeof r!="number"?null:{stream:n,ts:t.ts,line:t.line,...r!==void 0?{seq:r}:{}}}function wq(e){return e<0?Qc[0]:e>=Qc.length?Tq:Qc[e]}function QE(e,t,n){if(t.seq===void 0){const s=[...e,t];return s.length>Yo&&s.splice(0,s.length-Yo),{frames:s,lastSeq:n}}if(t.seq<=n)return{frames:e,lastSeq:n};const r=[...e,t];return r.length>Yo&&r.splice(0,r.length-Yo),{frames:r,lastSeq:t.seq}}const vq=(e,t)=>t!==void 0?`${nt()}/processes/${encodeURIComponent(e)}/stream?sinceSeq=${t}`:`${nt()}/processes/${encodeURIComponent(e)}/stream`,ax=3e3;function ix(e){if(e===null||typeof e!="object")return null;const t=e;if(!Array.isArray(t.processes))return null;const n=[];for(const r of t.processes){if(r===null||typeof r!="object")return null;const s=r;if(typeof s.agentId!="string"||typeof s.status!="string"||typeof s.startedAt!="string"||typeof s.pid!="number")return null;const i=s.exitCode;if(i!==null&&typeof i!="number")return null;const o=s.teamId,l=s.session,u=l!==null&&typeof l=="object"&&(l.mode==="persistent"||l.mode==="resume"||l.mode==="one-shot")?{mode:l.mode,...typeof l.id=="string"&&l.id.length>0?{id:l.id}:{}}:void 0;n.push({agentId:s.agentId,pid:s.pid,status:s.status,startedAt:s.startedAt,exitCode:i,teamId:typeof o=="string"?o:null,...u!==void 0?{session:u}:{}})}return n}function Aq(e){if(e===null||typeof e!="object")return null;const t=e;if(!Array.isArray(t.executions))return null;const n=[];for(const r of t.executions){if(r===null||typeof r!="object")return null;const s=r;if(typeof s.id!="string"||typeof s.label!="string"||typeof s.command!="string"||!Array.isArray(s.args)||!s.args.every(o=>typeof o=="string")||s.pid!==null&&typeof s.pid!="number"||typeof s.status!="string"||typeof s.startedAt!="string"||s.exitedAt!==null&&typeof s.exitedAt!="string"||s.exitCode!==null&&typeof s.exitCode!="number"||typeof s.source!="string"||s.agentId!==null&&typeof s.agentId!="string")return null;const i=s.teamId;n.push({id:s.id,label:s.label,command:s.command,args:s.args,pid:s.pid,status:s.status,startedAt:s.startedAt,exitedAt:s.exitedAt,exitCode:s.exitCode,source:s.source,teamId:typeof i=="string"?i:null,agentId:s.agentId})}return n}const kq=e=>`${nt()}/processes/${encodeURIComponent(e)}/stdin`,_q=()=>`${nt()}/messages`,Cq=()=>`${nt()}/processes`;function Iq({agentId:e}){const[t,n]=g.useState([]),[r,s]=g.useState("unknown"),[i,o]=g.useState(""),[l,u]=g.useState(null),[c,d]=g.useState(!1),p=g.useRef(-1),f=g.useRef(null),m=g.useRef(void 0),b=g.useRef(0),x=g.useRef(!0),y=g.useRef(null),E=g.useCallback(async T=>{try{const w=await Ge(new Request(Cq(),{signal:T}));if(!w.ok)return;const k=await w.json(),F=ix(k);if(!F)return;const C=F.find($=>$.agentId===e);C&&x.current&&s(C.status)}catch{}},[e]);g.useEffect(()=>{x.current=!0;let T=null;const w=()=>{T?.abort(),T=new AbortController,E(T.signal)};w();const k=setInterval(w,ax);return()=>{x.current=!1,T?.abort(),clearInterval(k)}},[E]);const v=g.useCallback(()=>{if(!x.current)return;const T=new EventSource(vq(e,p.current>-1?p.current:void 0));f.current=T,T.onmessage=w=>{try{const k=JSON.parse(w.data),F=Nq(k);if(!F)return;n(C=>{const $=QE(C,F,p.current);return p.current=$.lastSeq,$.frames}),b.current=0,d(!0)}catch{}},T.onerror=()=>{if(T.close(),f.current=null,d(!1),!x.current)return;const w=wq(b.current);b.current+=1,m.current=setTimeout(v,w)}},[e]);g.useEffect(()=>(v(),()=>{x.current=!1,f.current?.close(),f.current=null,m.current&&clearTimeout(m.current)}),[v]),g.useEffect(()=>{y.current&&t.length>0&&(y.current.scrollTop=y.current.scrollHeight)},[t]);const S=g.useCallback(async()=>{const T=i;if(T.length===0)return;u(null);const w={stream:"meta",ts:new Date().toISOString(),line:`> ${T}`};n(k=>QE(k,w,p.current).frames);try{const k=await Ge(new Request(kq(e),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({line:T})}));if(Ge(new Request(_q(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:"terminal",to:e,body:T})})).catch(()=>{}),!k.ok){const C=(await k.json().catch(()=>null))?.error??`stdin POST failed: ${k.status}`;u(C);return}o("")}catch(k){u(k instanceof Error?k.message:String(k))}},[e,i]),A=r==="running",N=T=>{T.key==="Enter"&&A&&(T.preventDefault(),S())};return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden","data-member-terminal":e,children:[a.jsxs("div",{className:"px-4 py-2 border-b border-spur-border bg-base-200 shrink-0 flex items-center gap-2",children:[a.jsx("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:"Terminal"}),a.jsx("span",{className:"font-mono text-xs text-spur-text-muted",children:e}),a.jsx(Lt,{variant:A?"success":"ghost",size:"xs","data-terminal-status":!0,children:r}),a.jsx("span",{className:"text-[10px] text-spur-text-muted","data-terminal-connected":!0,children:c?"connected":"reconnecting…"})]}),!A&&a.jsxs("div",{className:"px-4 py-1 text-xs text-warning border-b border-spur-border",role:"status","data-status-banner":!0,children:["Member is ",r," — input disabled."]}),a.jsx("pre",{ref:y,className:"flex-1 overflow-x-auto overflow-y-auto p-2 text-xs font-mono leading-snug bg-base-100","data-terminal-output":!0,children:t.length===0?a.jsxs("span",{className:"text-spur-text-muted italic",children:["Waiting for output from ",e,"…"]}):t.map((T,w)=>a.jsx("div",{className:T.stream==="stderr"?"text-error":T.stream==="meta"?"text-spur-text-muted italic":"text-spur-text","data-stream":T.stream,children:T.line},T.seq??`meta-${w}`))}),l&&a.jsx("div",{className:"px-4 py-1 text-xs text-error border-t border-spur-border",role:"alert","data-input-error":!0,children:l}),a.jsx("div",{className:"flex items-center gap-2 px-2 py-2 border-t border-spur-border bg-base-200 shrink-0",children:a.jsx("input",{type:"text",value:i,onChange:T=>o(T.target.value),onKeyDown:N,disabled:!A,placeholder:A?"Type a line and press Enter…":"Input disabled (member not running)",className:"flex-1 input input-sm font-mono","data-terminal-input":!0})})]})}const Rq=()=>`${nt()}/processes`;function Dq(e,t){const n=e.map(i=>({key:`sup:${i.agentId}`,label:i.agentId,agentId:i.agentId,pid:i.pid,status:i.status,startedAt:i.startedAt,source:"supervisor",teamId:i.teamId??null})),r=new Set(e.map(i=>i.agentId)),s=new Set(e.map(i=>i.pid).filter(i=>i!=null));for(const i of t)i.agentId&&r.has(i.agentId)||i.pid!=null&&s.has(i.pid)||n.push({key:`reg:${i.id}`,label:i.label||i.command,agentId:i.agentId??void 0,pid:i.pid,status:i.status,startedAt:i.startedAt,source:i.source,teamId:i.teamId??null});return n}function Oq(e,t){return e.filter(n=>{if(t.runningOnly&&n.status!=="running")return!1;if(t.source==="other"){if(n.source==="supervisor"||n.source==="one-shot")return!1}else if(t.source!=="all"&&n.source!==t.source)return!1;if(t.team==="unassigned"){if(n.teamId!=null)return!1}else if(t.team!=="all"&&n.teamId!==t.team)return!1;return!0})}function JE({filters:e,onFilters:t,teamIds:n,totalCount:r,shownCount:s}){return a.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-2 text-xs","data-processes-filters":!0,children:[a.jsxs("label",{className:"flex items-center gap-1","data-processes-filter-running":!0,children:[a.jsx("input",{type:"checkbox",checked:e.runningOnly,onChange:i=>t({...e,runningOnly:i.target.checked}),"data-processes-filter-running-input":!0}),a.jsx("span",{children:"Running only"})]}),a.jsxs("label",{className:"flex items-center gap-1",children:[a.jsx("span",{children:"Source"}),a.jsxs("select",{value:e.source,onChange:i=>t({...e,source:i.target.value}),className:"border border-spur-border rounded px-1 py-0.5 bg-spur-bg text-spur-text","data-processes-filter-source":!0,"aria-label":"Source filter",children:[a.jsx("option",{value:"all",children:"all"}),a.jsx("option",{value:"supervisor",children:"supervisor"}),a.jsx("option",{value:"one-shot",children:"one-shot"}),a.jsx("option",{value:"other",children:"other"})]})]}),a.jsxs("label",{className:"flex items-center gap-1",children:[a.jsx("span",{children:"Team"}),a.jsxs("select",{value:e.team,onChange:i=>t({...e,team:i.target.value}),className:"border border-spur-border rounded px-1 py-0.5 bg-spur-bg text-spur-text","data-processes-filter-team":!0,"aria-label":"Team filter",children:[a.jsx("option",{value:"all",children:"all teams"}),a.jsx("option",{value:"unassigned",children:"unassigned"}),n.map(i=>a.jsx("option",{value:i,children:i},i))]})]}),a.jsx("button",{type:"button",className:"border border-spur-border rounded px-2 py-0.5 text-spur-text hover:bg-base-200 transition-colors cursor-pointer",onClick:()=>t({runningOnly:!1,source:"all",team:"all"}),"data-processes-filter-clear":!0,children:"Clear"}),a.jsxs("span",{className:"text-spur-text-muted","data-processes-filter-count":!0,children:[s,"/",r," shown"]})]})}function Lq({pollMs:e=ax}){const[t,n]=g.useState(null),[r,s]=g.useState(null),[i,o]=g.useState({runningOnly:!1,source:"all",team:"all"}),l=g.useRef(!0),u=g.useCallback(async b=>{try{const x=await Ge(new Request(Rq(),{signal:b}));if(!x.ok)throw new Error(`processes fetch failed: ${x.status}`);const y=await x.json(),E=ix(y),v=Aq(y);if(!E||!v)return;l.current&&(n({processes:E,executions:v}),s(null))}catch(x){if(b.aborted)return;l.current&&s(x instanceof Error?x.message:String(x))}},[]);g.useEffect(()=>{l.current=!0;let b=null;const x=()=>{b?.abort(),b=new AbortController,u(b.signal)};x();const y=setInterval(x,e);return()=>{l.current=!1,b?.abort(),clearInterval(y)}},[u,e]);const c=g.useMemo(()=>t?Dq(t.processes,t.executions):[],[t]),d=g.useMemo(()=>Oq(c,i),[c,i]),p=g.useMemo(()=>{const b=new Set;for(const x of t?.processes??[])x.teamId&&b.add(x.teamId);for(const x of t?.executions??[])x.teamId&&b.add(x.teamId);return[...b].sort()},[t]);if(r&&(!t||c.length===0))return a.jsxs("div",{className:"p-4 text-sm text-error",role:"alert","data-processes-tab-error":!0,children:["Failed to load processes: ",r]});if(!t)return a.jsx("div",{className:"p-4","data-processes-tab-loading":!0,children:a.jsx(Ss,{size:"sm"})});if(c.length===0)return a.jsxs("div",{className:"p-4 text-sm text-spur-text-muted","data-processes-tab-empty":!0,children:["No processes. Start an agent from the Agents tab or via"," ",a.jsx("code",{className:"font-mono",children:"spur agent start"}),"."]});if(d.length===0)return a.jsxs("div",{className:"p-3 overflow-auto h-full","data-processes-tab":!0,"data-processes-tab-filtered-empty":!0,children:[a.jsx(JE,{filters:i,onFilters:o,teamIds:p,totalCount:c.length,shownCount:0}),a.jsx("div",{className:"p-4 text-sm text-spur-text-muted","data-processes-tab-no-matches":!0,children:"No processes match the current filters. Adjust or clear filters to see rows."})]});const f=t.processes.length,m=Math.max(0,c.length-f);return a.jsxs("div",{className:"p-3 overflow-auto h-full","data-processes-tab":!0,children:[a.jsx(JE,{filters:i,onFilters:o,teamIds:p,totalCount:c.length,shownCount:d.length}),a.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs text-spur-text-muted",children:[a.jsxs("span",{"data-processes-header":!0,children:["Process watch list (",c.length,f>0||m>0?` · ${f} supervised${m>0?` · ${m} other`:""}`:"",")"]}),a.jsx("span",{className:"italic",children:"— ProcessExecutor registry (ts-runtime)"})]}),a.jsxs("table",{className:"table table-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Name"}),a.jsx("th",{children:"Source"}),a.jsx("th",{children:"Team"}),a.jsx("th",{children:"PID"}),a.jsx("th",{children:"Status"}),a.jsx("th",{children:"Started"})]})}),a.jsx("tbody",{children:d.map(b=>{const x=b.status==="running";return a.jsxs("tr",{"data-processes-row":b.key,children:[a.jsx("td",{className:"font-mono text-xs",children:b.label}),a.jsx("td",{className:"text-xs text-spur-text-muted","data-process-source":b.source,children:b.source}),a.jsx("td",{className:"font-mono text-xs text-spur-text-muted","data-process-team":b.teamId??"",children:b.teamId??"—"}),a.jsx("td",{className:"font-mono text-xs text-spur-text-muted",children:b.pid??"—"}),a.jsx("td",{children:a.jsx(Lt,{variant:x?"success":"ghost",size:"xs",children:b.status})}),a.jsx("td",{className:"text-xs text-spur-text-muted",children:new Date(b.startedAt).toLocaleTimeString()})]},b.key)})})]})]})}const jq="conversation",mr=[{id:"conversation",label:"Conversation",component:yq},{id:"processes",label:"Processes",component:Lq}];function Mq(){const e=Pi(),t=ip();return{activeTab:(()=>{const s=e.pathname.split("/"),i=s.indexOf("projects"),o=i>=0?s[i+1]:void 0;return mr.some(l=>l.id===o)?o:jq})(),selectTab:s=>{const i=new URLSearchParams(e.search).toString();t(`/board/projects/${s}${i?`?${i}`:""}`,{replace:!0})}}}function Fq(e){if(e.state==="loading")return"loading";if(e.state==="unresolvable")return"unresolvable";if(e.fleet===null)return"fleet-unavailable";const{orchestrator:t,capacity:n,strategy:r}=e.fleet;return t.state!=="bound-online"?t.state:n.total===0?"no-fleet":n.missing.length>0?"capacity-missing":r===null?"strategy-unavailable":"ready"}function Uv(){const e=_a(),{activeTab:t,selectTab:n}=Mq(),s=(mr.find(l=>l.id===t)??mr[0])?.component,i=Fq(e),o=l=>{if(l.key!=="ArrowRight"&&l.key!=="ArrowLeft")return;l.preventDefault();const u=mr.findIndex(p=>p.id===t),c=l.key==="ArrowRight"?1:-1,d=mr[(u+c+mr.length)%mr.length];d&&(l.currentTarget.querySelectorAll('[role="tab"]')[mr.indexOf(d)]?.focus(),n(d.id))};return a.jsxs("div",{className:"projects flex flex-col h-full gap-4 p-4 max-w-[1600px] mx-auto w-full overflow-hidden","data-projects-shell":!0,children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-base-content/10 pb-3 shrink-0","data-projects-header":!0,"data-projects-state":i,children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:"📁"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight",children:"Projects"}),a.jsx("p",{className:"text-xs text-base-content/60",children:"Conversation and processes for this project"})]})]}),a.jsx("div",{role:"tablist","aria-label":"Projects tabs",onKeyDown:o,className:"flex items-center gap-1 bg-base-300 p-1 rounded-xl",children:mr.map(l=>{const u=l.id===t;return a.jsx("button",{type:"button",role:"tab","aria-selected":u,"aria-controls":`projects-tab-panel-${l.id}`,id:`projects-tab-${l.id}`,onClick:()=>n(l.id),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer ${u?"bg-primary text-primary-content font-bold shadow-sm":"text-base-content/70 hover:bg-base-content/10"}`,"data-projects-tab":l.id,children:l.label},l.id)})})]}),a.jsx("div",{role:"tabpanel",id:`projects-tab-panel-${t}`,"aria-labelledby":`projects-tab-${t}`,className:"flex-1 min-h-0 overflow-hidden",children:s?a.jsx(s,{}):null})]})}const Pq={id:"projects",name:"Projects",icon:"📁",route:"projects",component:Uv,sidebarLabel:"Projects",description:"Conversation and processes for this project",order:45},Bq=Object.freeze(Object.defineProperty({__proto__:null,ProjectsShell:Uv,module:Pq},Symbol.toStringTag,{value:"Module"})),Uq=100,$q=()=>`${nt()}/events/history?limit=${Uq}`,zq=["agent.","message.","task.","supervisor.","process."];function Hq(e){return zq.some(t=>e.startsWith(t))}function Gq(e){if(e===null||typeof e!="object")return null;const t=e;if(typeof t.eventName!="string"||typeof t.occurredAt!="string"||!Hq(t.eventName))return null;const n=t.payload!==null&&typeof t.payload=="object"?t.payload:null,r=n&&typeof n.teamId=="string"&&n.teamId.length>0?n.teamId:void 0,s=n&&typeof n.agentType=="string"&&n.agentType.length>0?n.agentType:void 0,i=n&&typeof n.memberLabel=="string"&&n.memberLabel.length>0?n.memberLabel:n&&typeof n.agentId=="string"&&n.agentId.length>0?n.agentId:void 0,o=typeof t.actor=="string"&&t.actor.length>0?t.actor:n&&typeof n.agentId=="string"&&n.agentId.length>0?n.agentId:null;return{id:typeof t.id=="string"?t.id:`${t.eventName}-${t.occurredAt}`,eventName:t.eventName,occurredAt:t.occurredAt,actor:o,...r?{teamId:r}:{},...i?{memberLabel:i}:{},...s?{agentType:s}:{}}}function Wq(e){if(e===null||typeof e!="object"||!("events"in e))return null;const t=e.events;if(!Array.isArray(t))return null;const n=[];for(const r of t){const s=Gq(r);s&&n.push(s)}return n}function $v(e){return e===void 0?null:e.id===void 0?e.mode:`${e.mode} · ${e.id.slice(0,8)}`}function e1(e,t){const{state:n,instanceId:r}=t.orchestrator;return n!=="bound-online"&&n!=="bound-offline"?!1:r!==void 0&&r===e.instanceId}function qq(e,t){const n=new Map(t.map(s=>[s.agentId,s])),r=[];for(const s of e.members){const i=n.get(s.instanceId),o={status:t1(i),pid:i?.pid??null,startedAt:i?.startedAt??null,exitCode:i?.exitCode??null,session:i?.session??null},l=[];s.enabled===!1&&l.push("disabled"),s.capabilityState==="unavailable"&&l.push("executor-unavailable"),s.capabilityState==="unknown"&&l.push("capability-unknown"),e.capacity.missing.includes(s.instanceId)&&l.push("unresolved"),r.push({instanceId:s.instanceId,declared:s,observed:o,isOrchestrator:e1({instanceId:s.instanceId},e),issues:l})}for(const s of t)e.members.some(i=>i.instanceId===s.agentId)||s.agentId!==$u&&r.push({instanceId:s.agentId,declared:null,observed:{status:t1(s),pid:s.pid,startedAt:s.startedAt,exitCode:s.exitCode,session:s.session??null},isOrchestrator:e1({instanceId:s.agentId},e),issues:["undeclared"]});return r.sort((s,i)=>s.isOrchestrator!==i.isOrchestrator?s.isOrchestrator?-1:1:s.instanceId<i.instanceId?-1:s.instanceId>i.instanceId?1:0),r}function t1(e){return e===void 0?"not-started":e.status==="running"?"running":"exited"}const zv=6e4,ep=60*zv,n1=24*ep;function Vq(e,t){if(e===null)return null;const n=new Date(e).getTime(),r=Date.now()-n;if(Number.isNaN(n)||r<0)return null;const s=Math.floor(r/n1),i=Math.floor(r%n1/ep),o=Math.floor(r%ep/zv);return s>0?`up ${s}d ${i}h`:i>0?`up ${i}h ${o}m`:`up ${o}m`}const Yq=e=>`${nt()}/messages/inbox?agent=${encodeURIComponent(e)}`,Kq=(e,t)=>`${nt()}/agents/${encodeURIComponent(e)}/${t}`;function Zq({entry:e,onClose:t}){const n=_a(),r=n.fleet?.path??n.path??"Unavailable",s=e.declared===null?"Unavailable":e.declared.model??"Executor default",[i,o]=g.useState(null),[l,u]=g.useState(null),[c,d]=g.useState(!1),[p,f]=g.useState(null);g.useEffect(()=>{const E=v=>{v.key==="Escape"&&t()};return document.addEventListener("keydown",E),()=>document.removeEventListener("keydown",E)},[t]),g.useEffect(()=>{let E=!1;return o(null),Ge(new Request(Yq(e.instanceId))).then(async v=>v.ok?Lv(await v.json()):[]).then(v=>{E||o(v)}).catch(()=>{E||o([])}),()=>{E=!0}},[e.instanceId]),g.useEffect(()=>{let E=!1;return u(null),Ge(new Request($q())).then(async v=>v.ok?Wq(await v.json()):[]).then(v=>{E||u((v??[]).filter(S=>S.memberLabel===e.instanceId||S.actor===e.instanceId))}).catch(()=>{E||u([])}),()=>{E=!0}},[e.instanceId]);const m=e.issues.includes("executor-unavailable")||e.issues.includes("unresolved"),b=e.issues.includes("executor-unavailable")?"controls disabled — executor unavailable":e.issues.includes("unresolved")?"controls disabled — member unresolved":null,x=async E=>{d(!0),f(null);try{const v=await Ge(new Request(Kq(e.instanceId,E),{method:"POST"}));v.ok||f(`${E} failed: ${v.status}`)}catch(v){f(v instanceof Error?v.message:String(v))}finally{d(!1)}},y=e.observed.status==="running";return a.jsxs("div",{className:"shrink-0 h-[55%] flex flex-col border-t border-spur-border bg-spur-surface","data-member-detail":!0,children:[a.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-spur-border shrink-0",children:[a.jsx("span",{className:"text-sm font-semibold text-spur-text",children:e.declared?.role??"member"}),a.jsx("button",{type:"button",className:"ml-auto px-2 py-0.5 rounded-lg text-xs text-spur-text-muted hover:text-spur-text","aria-label":"Close member detail",onClick:t,"data-member-detail-close":!0,children:"close ✕"})]}),a.jsxs("div",{className:"px-3 py-2 border-b border-spur-border shrink-0 flex flex-col gap-1 text-xs",children:[a.jsxs("span",{className:"text-spur-text-muted",children:["declared:"," ",a.jsx("span",{className:"text-spur-text",children:e.declared===null?"none":`${e.declared.enabled?"enabled":"disabled"} · capability ${e.declared.capabilityState}`})]}),a.jsxs("span",{className:"text-spur-text-muted",children:["observed:"," ",a.jsxs("span",{className:"text-spur-text",children:[e.observed.status,e.observed.pid!==null?` — pid ${e.observed.pid}`:"",e.observed.exitCode!==null?` — exit ${e.observed.exitCode}`:""]})]}),a.jsxs("span",{className:"text-spur-text-muted","data-member-session":!0,children:["session:"," ",a.jsx("span",{className:"font-mono text-spur-text",children:$v(e.observed.session??e.declared?.session)??"—"})]}),a.jsxs("dl",{className:"grid grid-cols-[auto_1fr] gap-x-2 gap-y-1",children:[a.jsx("dt",{className:"text-spur-text-muted",children:"Working directory"}),a.jsx("dd",{className:"font-mono text-spur-text break-all","data-member-workdir":!0,children:r}),a.jsx("dt",{className:"text-spur-text-muted",children:"Model"}),a.jsx("dd",{className:"font-mono text-spur-text break-all","data-member-model":!0,children:s})]})]}),a.jsxs("div",{className:"px-3 py-2 border-b border-spur-border shrink-0 flex items-center gap-2 flex-wrap",children:[a.jsx("button",{type:"button",className:"px-2 py-0.5 rounded-lg text-xs bg-spur-accent text-white disabled:opacity-40",disabled:c||m||y,onClick:()=>{x("start")},"data-member-start":!0,children:"start"}),a.jsx("button",{type:"button",className:"px-2 py-0.5 rounded-lg text-xs bg-spur-surface-3 text-spur-text disabled:opacity-40",disabled:c||m||!y,onClick:()=>{x("stop")},"data-member-stop":!0,children:"stop"}),b!==null&&a.jsx("span",{className:"text-xs text-spur-text-muted","data-lifecycle-reason":!0,children:b}),p!==null&&a.jsx("span",{className:"text-xs text-error",role:"alert","data-lifecycle-error":!0,children:p})]}),a.jsx("div",{className:"flex-1 min-h-0 border-b border-spur-border",children:a.jsx(Iq,{agentId:e.instanceId})}),a.jsxs("div",{className:"shrink-0 h-[35%] flex overflow-hidden",children:[a.jsxs("div",{className:"flex-1 overflow-y-auto p-2 border-r border-spur-border","data-member-messages":!0,children:[a.jsx("div",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide mb-1",children:"Messages"}),(i??[]).length===0&&a.jsx("div",{className:"text-xs text-spur-text-muted italic",children:i===null?"Loading…":"No inbox messages."}),(i??[]).slice(0,20).map(E=>a.jsxs("div",{className:"text-xs border-t border-spur-border py-1","data-member-message":E.id,children:[a.jsxs("span",{className:"font-mono text-spur-text-muted",children:[E.fromId??"system"," → ",E.toId]}),a.jsx("span",{className:"ml-1 px-1 rounded bg-spur-surface-3 text-spur-text",children:E.status}),a.jsx("span",{className:"ml-1 font-mono text-spur-text-muted",children:E.createdAt}),a.jsx("p",{className:"text-spur-text mt-0.5 whitespace-pre-wrap break-words",children:E.body})]},E.id))]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-2","data-member-activity":!0,children:[a.jsx("div",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide mb-1",children:"Activity"}),(l??[]).length===0&&a.jsx("div",{className:"text-xs text-spur-text-muted italic",children:l===null?"Loading…":"No activity for this member."}),(l??[]).slice(0,20).map(E=>a.jsxs("div",{className:"text-xs border-t border-spur-border py-1","data-member-activity-row":E.eventName,children:[a.jsx("span",{className:"font-mono text-spur-text-muted",children:E.occurredAt})," ",a.jsx("span",{className:"text-spur-text",children:E.eventName})]},E.id))]})]})]})}const Xq=()=>`${nt()}/project/fleet`,Qq=()=>`${nt()}/processes`,Jq=()=>`${nt()}/project/executors/availability`,r1=[{name:"scribe",tier:"cheap",stages:["changelog"],isCustom:!1},{name:"coder",tier:"standard",stages:["implement","test","wrap"],isCustom:!1},{name:"reviewer",tier:"capable-1",stages:["verify","review","dogfood"],isCustom:!1},{name:"planner",tier:"capable-2",stages:["plan","refine","brainstorm"],isCustom:!1}],eV=[{id:"plan",alias:"/sp:dev-plan",description:"Intake and decompose feature into spec and tasks",role:"planner",tier:"capable-2",skill:"sp:super-planner"},{id:"refine",alias:"/sp:dev-refine",description:"Clarify task ambiguity and acceptance criteria",role:"planner",tier:"capable-2",skill:"sp:super-planner"},{id:"brainstorm",alias:"/sp:brainstorm",description:"Structured ideation with trade-offs and options",role:"planner",tier:"capable-2",skill:"sp:brainstorm"},{id:"implement",alias:"/sp:dev-run",description:"Transform requirements into production code",role:"coder",tier:"standard",skill:"sp:super-coder"},{id:"test",alias:"/sp:dev-unit",description:"Generate and extend unit and regression test suites",role:"coder",tier:"standard",skill:"sp:code-testing"},{id:"review",alias:"/sp:dev-review",description:"Multi-dimensional SECUA code review",role:"reviewer",tier:"capable-1",skill:"sp:super-reviewer"},{id:"verify",alias:"/sp:dev-verify",description:"Traceability and acceptance criteria verification",role:"reviewer",tier:"capable-1",skill:"sp:code-verification"},{id:"dogfood",alias:"/sp:dev-dogfood",description:"End-to-end dogfood verification with retry ledger",role:"reviewer",tier:"capable-1",skill:"sp:dogfood-testing"},{id:"wrap",alias:"/sp:dev-wrap",description:"Capture learnings, metrics, and documentation sync",role:"coder",tier:"standard",skill:"sp:doc-evolve"},{id:"changelog",alias:"/sp:dev-changelog",description:"Generate conventional release notes and summaries",role:"scribe",tier:"cheap",skill:"sp:dev-changelog"}];function s1(e){const t=new Map(e.map(n=>[n.name,n]));return eV.map(n=>{const r=t.get(n.role);return{...n,tier:r?.tier??n.tier,electedExecutor:r?.electedExecutor??null,candidateExecutors:r?.candidateExecutors??[]}})}function tV(e){if(e===null||typeof e!="object")return!1;const t=e,n=t.capacity;return Array.isArray(t.members)&&t.members.every(r=>r!==null&&typeof r=="object"&&typeof r.instanceId=="string")&&n!==null&&typeof n=="object"&&Array.isArray(n.missing)&&t.orchestrator!==null&&typeof t.orchestrator=="object"}const Jc={"executor-unavailable":{icon:"⛔",label:"executor unavailable",action:"the executor cannot run here — check the executor's install/attestation"},"capability-unknown":{icon:"❔",label:"capability unknown",action:"no attestation exists; it grants nothing and is not a failure"},unresolved:{icon:"⚠️",label:"unresolved",action:"the instance is listed in the fleet capacity as missing"},undeclared:{icon:"❗",label:"undeclared",action:"a live process with no declared member"},disabled:{icon:"⏸️",label:"disabled",action:"declared with enabled: false"}};function nV(e,t){return e.observed.status==="running"?{label:"running",action:null}:t&&e.isOrchestrator?{label:"orchestrator offline",action:"its claim is held but stale — see project_claims"}:e.issues.includes("executor-unavailable")||e.issues.includes("capability-unknown")?{label:e.observed.status==="exited"?"exited":"not started",action:null}:{label:"not running",action:"start it"}}function ox(e){switch(e){case"cheap":return"bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 border border-emerald-500/20";case"standard":return"bg-blue-500/10 text-blue-700 dark:text-blue-400 border border-blue-500/20";case"capable-1":return"bg-purple-500/10 text-purple-700 dark:text-purple-400 border border-purple-500/20";case"capable-2":return"bg-indigo-500/10 text-indigo-700 dark:text-indigo-400 border border-indigo-500/20";case"capable-3":return"bg-amber-500/10 text-amber-800 dark:text-amber-400 border border-amber-500/20";default:return"bg-spur-surface-3 text-spur-text-muted border border-spur-border"}}const a1={cheap:1,standard:2,"capable-1":3,"capable-2":4,"capable-3":5};function Hv({pollMs:e=ax}){const t=_a(),[n,r]=g.useState(null),[s,i]=g.useState(r1),[o,l]=g.useState(()=>s1(r1)),[u,c]=g.useState([]),[d,p]=g.useState(null),[f,m]=g.useState(!1),[b,x]=g.useState(null),[y,E]=g.useState(!1),[v,S]=g.useState("all"),[A,N]=g.useState(""),[T,w]=g.useState(""),[k,F]=g.useState(null),C=g.useRef(null),$=g.useRef(async()=>{});g.useEffect(()=>{let q=!1,re=null;const pe=async()=>{re?.abort(),re=new AbortController;const Z=re.signal;try{const[ie,L]=await Promise.all([Ge(new Request(Xq(),{signal:Z})),Ge(new Request(Qq(),{signal:Z}))]);if(q||!ie.ok||!L.ok)return;const Ee=await ie.json(),fe=await L.json();if(q||!tV(Ee))return;const Y=ix(fe);if(!Y)return;r(qq(Ee,Y)),Ee.roles&&Ee.roles.length>0&&i(Ee.roles),Ee.stages&&Ee.stages.length>0?l(Ee.stages):Ee.roles&&Ee.roles.length>0&&l(s1(Ee.roles)),c(Ee.executors??[]),p(Ee),E(Ee.orchestrator.state==="bound-offline"),m(!1)}catch{q||m(!0)}};$.current=pe,pe();const I=setInterval(()=>{pe()},e);return()=>{q=!0,clearInterval(I),re?.abort()}},[e]);const z=g.useCallback((q,re)=>{C.current=re,x(q.instanceId)},[]),M=g.useCallback(()=>{x(null),C.current?.focus()},[]),G=g.useMemo(()=>{if(!A.trim())return u;const q=A.toLowerCase();return u.filter(re=>re.name.toLowerCase().includes(q)||re.agent.toLowerCase().includes(q)||!!re.model?.toLowerCase().includes(q)||re.tier.toLowerCase().includes(q))},[u,A]),H=g.useMemo(()=>{if(!T.trim())return o;const q=T.toLowerCase();return o.filter(re=>re.id.toLowerCase().includes(q)||re.role.toLowerCase().includes(q)||re.tier.toLowerCase().includes(q)||!!re.alias?.toLowerCase().includes(q)||!!re.skill?.toLowerCase().includes(q)||re.description.toLowerCase().includes(q))},[o,T]),j=n?.find(q=>q.instanceId===b)??null;return a.jsxs("div",{className:"flex flex-col h-full overflow-hidden bg-spur-bg","data-agents-view":!0,children:[a.jsxs("div",{className:"flex-1 overflow-y-auto p-3 space-y-6",children:[n===null&&!f&&a.jsx("div",{className:"p-4 text-sm text-spur-text-muted italic","data-roster-loading":!0,children:"Loading fleet roster…"}),f&&a.jsx("div",{className:"p-4 text-sm text-spur-text-muted","data-roster-fetch-failed":!0,role:"alert",children:"Fleet roster unavailable — the fleet or process feed could not be read."}),n!==null&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pb-3 border-b border-spur-border/50",children:[a.jsx("div",{className:"flex items-center gap-1.5 p-1 bg-spur-surface-2 rounded-xl border border-spur-border",children:[{id:"all",label:"All"},{id:"roles",label:"Roles",count:s.length},{id:"stages",label:"Stages",count:o.length},{id:"executors",label:"Executors",count:u.length},{id:"fleet",label:"Fleet",count:n.length}].map(q=>a.jsxs("button",{type:"button",onClick:()=>S(q.id),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer flex items-center gap-1.5 ${v===q.id?"bg-spur-accent text-white shadow-sm":"text-spur-text-muted hover:text-spur-text hover:bg-spur-surface-3"}`,"data-section-filter":q.id,children:[a.jsx("span",{children:q.label}),"count"in q&&a.jsx("span",{className:`px-1.5 py-0.5 rounded-full text-[10px] font-mono transition-colors ${v===q.id?"bg-white/20 text-white":"bg-spur-surface-3 text-spur-text-muted"}`,children:q.count})]},q.id))}),v==="stages"&&o.length>0&&a.jsx("input",{type:"text",placeholder:"Filter stages by id, role, alias...",value:T,onChange:q=>w(q.target.value),className:"px-3 py-1.5 bg-spur-surface border border-spur-border rounded-lg text-xs text-spur-text placeholder:text-spur-text-muted/60 focus:outline-none focus:ring-1 focus:ring-spur-accent min-w-[240px]","data-stage-filter":!0}),v==="executors"&&u.length>0&&a.jsx("input",{type:"text",placeholder:"Filter executors by name, agent, model...",value:A,onChange:q=>N(q.target.value),className:"px-3 py-1.5 bg-spur-surface border border-spur-border rounded-lg text-xs text-spur-text placeholder:text-spur-text-muted/60 focus:outline-none focus:ring-1 focus:ring-spur-accent min-w-[240px]"})]}),(v==="all"||v==="roles")&&a.jsxs("section",{className:"space-y-3","data-roles-section":!0,children:[a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold tracking-tight text-spur-text",children:"Agent Roles"}),a.jsx("code",{className:"text-[11px] font-mono px-2 py-0.5 rounded-md bg-spur-surface-2 border border-spur-border text-spur-accent",children:"agent.roles"})]}),a.jsx("span",{className:"text-xs text-spur-text-muted",children:"Routing roles mapped to capability tiers and folded stages"})]}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4","data-roles-grid":!0,children:s.map(q=>a.jsx(sV,{role:q,executors:u},q.name))})]}),v==="all"&&a.jsx("hr",{className:"border-0 border-t border-spur-border/50 my-1"}),(v==="all"||v==="stages")&&a.jsxs("section",{className:"space-y-3","data-stages-section":!0,children:[a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold tracking-tight text-spur-text",children:"Pipeline Stages"}),a.jsx("code",{className:"text-[11px] font-mono px-2 py-0.5 rounded-md bg-spur-surface-2 border border-spur-border text-spur-accent",children:"pipeline.stages"}),o.length>0&&a.jsxs("span",{className:"text-xs text-spur-text-muted font-mono",children:["(",o.length," defined)"]})]}),a.jsx("span",{className:"text-xs text-spur-text-muted",children:"Pipeline execution stages from the perspective of agent executors and capability tiers"})]}),H.length===0?a.jsx("div",{className:"p-4 rounded-xl bg-spur-surface border border-spur-border text-xs text-spur-text-muted",children:o.length===0?"No pipeline stages defined.":"No stages match filter."}):a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3","data-stages-grid":!0,children:H.map(q=>a.jsx(iV,{stage:q,executors:u},q.id))})]}),v==="all"&&a.jsx("hr",{className:"border-0 border-t border-spur-border/50 my-1"}),(v==="all"||v==="executors")&&a.jsxs("section",{className:"space-y-3","data-executors-section":!0,children:[a.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold tracking-tight text-spur-text",children:"Agent Executors"}),a.jsx("code",{className:"text-[11px] font-mono px-2 py-0.5 rounded-md bg-spur-surface-2 border border-spur-border text-spur-accent",children:"agent.executors"}),u.length>0&&a.jsxs("span",{className:"text-xs text-spur-text-muted font-mono",children:["(",u.filter(q=>!q.disabled).length," active,"," ",u.filter(q=>q.disabled).length," disabled)"]})]}),a.jsx("span",{className:"text-xs text-spur-text-muted",children:"Execution profiles pairing CLI runtimes with models and capability tiers"})]}),G.length===0?a.jsx("div",{className:"p-4 rounded-xl bg-spur-surface border border-spur-border text-xs text-spur-text-muted",children:u.length===0?"No executor profiles defined in config.":"No executors match filter."}):a.jsx("div",{className:"grid gap-3 md:grid-cols-2 xl:grid-cols-3","data-executors-grid":!0,children:G.map(q=>a.jsx(oV,{executor:q,onToggle:re=>F({executor:re,targetDisabled:!re.disabled})},q.name))})]}),v==="all"&&a.jsx("hr",{className:"border-0 border-t border-spur-border/50 my-1"}),(v==="all"||v==="fleet")&&a.jsxs("section",{className:"space-y-3","data-fleet-section":!0,children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-x-4 gap-y-1",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold tracking-tight text-spur-text",children:"Agent Fleet"}),a.jsx("code",{className:"text-[11px] font-mono px-2 py-0.5 rounded-md bg-spur-surface-2 border border-spur-border text-spur-accent",children:"agent.fleet"})]}),d&&a.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-xs",children:[a.jsx("span",{className:`px-2 py-0.5 rounded-md font-medium text-[11px] ${d.enabled?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-spur-surface-2 border border-spur-border text-spur-text-muted"}`,children:d.enabled?"Fleet Enabled":"Fleet Disabled"}),d.strategy&&a.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-spur-surface-2 border border-spur-border text-spur-text text-[11px]",children:["strategy:"," ",a.jsx("strong",{className:"font-mono text-spur-accent",children:d.strategy.name})]}),a.jsxs("span",{className:"px-2 py-0.5 rounded-md bg-spur-surface-2 border border-spur-border text-spur-text text-[11px]",children:["orchestrator:"," ",a.jsx("span",{className:"font-mono text-spur-text-muted",children:d.orchestrator.state})]})]})]}),n.length===0&&a.jsxs("div",{className:"p-4 text-sm text-spur-text-muted italic bg-spur-surface border border-spur-border rounded-xl","data-roster-empty":!0,children:["No agents for this project — declare members under"," ",a.jsx("code",{className:"font-mono text-spur-accent",children:"agent.fleet"})," in"," ",a.jsx("code",{className:"font-mono text-spur-accent",children:`${t.path??"this project"}/.spur/config.yaml`}),"."]}),n.length>0&&a.jsx("div",{className:"grid gap-2 md:grid-cols-2 xl:grid-cols-3","data-roster-grid":!0,children:n.map(q=>a.jsx(lV,{entry:q,orchestratorOffline:y,onOpen:z},q.instanceId))})]})]})]}),j!==null&&a.jsx(Zq,{entry:j,onClose:M}),k!==null&&a.jsx(uV,{executor:k.executor,targetDisabled:k.targetDisabled,onClose:()=>F(null),onSuccess:()=>{const q=k;F(null),q&&c(re=>re.map(pe=>pe.name===q.executor.name?{...pe,disabled:q.targetDisabled}:pe)),$.current?.()}})]})}function Gv({tier:e,electedExecutor:t,candidateExecutors:n,executors:r}){const s=e||"standard",i=r.filter(f=>(f.tier??"standard")===s),o=i.length>0?i:r.filter(f=>{const m=a1[s]??0;return(a1[f.tier??"standard"]??0)>=m}),l=t??o.find(f=>!f.disabled&&f.usable!==!1)?.name,u=l?o.find(f=>f.name===l)??r.find(f=>f.name===l):void 0,c=o.filter(f=>f.name!==l&&!f.disabled),d=o.filter(f=>f.name!==l&&f.disabled),p=[];u&&p.push({name:u.name,isDefault:!0,disabled:u.disabled,model:u.model,agent:u.agent});for(const f of c)p.push({name:f.name,isDefault:!1,disabled:!1,model:f.model,agent:f.agent});for(const f of d)p.push({name:f.name,isDefault:!1,disabled:!0,model:f.model,agent:f.agent});return p.length===0&&n&&n.length>0?n.map((f,m)=>{const b=r.find(x=>x.name===f);return{name:f,isDefault:f===t||m===0,disabled:b?.disabled??!1,agent:b?.agent,model:b?.model}}):p}function i1(e){return[`Agent: ${e.agent||"—"}`,`Model: ${e.model||"default"}`].join(`
|
|
313
313
|
`)}const rV={scribe:"✍️",coder:"💻",reviewer:"🔍",planner:"📋"};function Wv(e){return e.sourcePath??(e.sourceLayer==="project"?".spur/config.yaml":"~/.config/spur/config.yaml")}function qv({cand:e,kind:t}){const n=t==="role"?{"data-role-executor-item":e.name}:{"data-stage-executor-item":e.name};return a.jsx(Br,{position:"top",tip:i1(e),className:"inline-flex! z-30 [&:before]:whitespace-pre-line! [&:before]:text-left! [&:before]:font-mono [&:before]:text-[11px] [&:before]:p-2 [&:before]:rounded-lg [&:before]:shadow-xl after:whitespace-pre-line after:text-left after:font-mono after:text-[11px]",children:a.jsxs("span",{className:`px-1.5 py-0.5 rounded text-[11px] font-mono inline-flex items-center gap-1 border transition-colors cursor-help ${e.isDefault?"bg-amber-500/15 border-amber-500/40 text-amber-800 dark:text-amber-300 font-semibold":e.disabled?"bg-spur-surface-2/40 border-spur-border/40 text-spur-text-muted/60 dark:text-spur-text-muted/50 line-through":"bg-spur-surface-2 border-spur-border/60 text-spur-text hover:border-spur-accent/30"}`,title:i1(e),...n,children:[a.jsx("span",{children:e.name}),e.isDefault&&a.jsx("span",{role:"img","aria-label":"default executor",children:"⭐"})]})})}function sV({role:e,executors:t=[]}){const n=rV[e.name.toLowerCase()]??"🤖",r=g.useMemo(()=>Gv({tier:e.tier,electedExecutor:e.electedExecutor,candidateExecutors:e.candidateExecutors,executors:t}),[t,e.tier,e.electedExecutor,e.candidateExecutors]);return a.jsxs("div",{className:"p-3.5 bg-spur-surface border border-spur-border rounded-xl flex flex-col justify-between gap-3 hover:border-spur-accent/40 transition-colors shadow-sm","data-role-card":e.name,children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-base","aria-hidden":"true",children:n}),a.jsx("span",{className:"font-semibold text-sm capitalize text-spur-text",children:e.name})]}),a.jsx("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded-md font-medium ${ox(e.tier)}`,children:e.tier})]}),a.jsxs("div",{className:"mt-2.5",children:[a.jsx("div",{className:"text-[10px] uppercase tracking-wider text-spur-text-muted font-medium mb-1",children:"Stages"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:e.stages.map(s=>a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border/60 text-[11px] font-mono text-spur-text",children:s},s))})]}),a.jsxs("div",{className:"mt-2.5",children:[a.jsxs("div",{className:"text-[10px] uppercase tracking-wider text-spur-text-muted font-medium mb-1 flex items-center justify-between",children:[a.jsx("span",{children:"Executors"}),a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted/70",children:[r.length," in tier"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1","data-role-executors":e.name,children:r.length>0?r.map(s=>a.jsx(qv,{cand:s,kind:"role"},s.name)):a.jsx("span",{className:"text-[11px] font-mono text-spur-text-muted italic",children:"none in tier"})})]})]}),a.jsx("div",{className:"pt-2 border-t border-spur-border/40 flex flex-col gap-1 text-[11px] text-spur-text-muted",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{children:"source"}),a.jsx("span",{className:"font-mono text-spur-text",children:e.isCustom?"project override":"built-in / global"})]})})]})}const aV={plan:"📋",refine:"🔧",brainstorm:"💡",implement:"💻",test:"🧪",review:"🔍",verify:"✅",dogfood:"🐶",wrap:"🎁",changelog:"📝"};function iV({stage:e,executors:t=[]}){const n=aV[e.id.toLowerCase()]??"⚙️",r=g.useMemo(()=>Gv({tier:e.tier,electedExecutor:e.electedExecutor,candidateExecutors:e.candidateExecutors,executors:t}),[t,e.tier,e.electedExecutor,e.candidateExecutors]);return a.jsx("div",{className:"p-3.5 bg-spur-surface border border-spur-border rounded-xl flex flex-col justify-between gap-3 hover:border-spur-accent/40 transition-colors shadow-sm","data-stage-card":e.id,children:a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-base","aria-hidden":"true",children:n}),a.jsx("span",{className:"font-semibold text-sm font-mono text-spur-text",children:e.id}),e.alias&&a.jsx("code",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border text-spur-accent",children:e.alias})]}),a.jsx("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded-md font-medium ${ox(e.tier)}`,children:e.tier})]}),a.jsx("p",{className:"mt-2 text-xs text-spur-text-muted leading-relaxed line-clamp-2 min-h-[2.5rem]",children:e.description}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1.5 text-[11px]",children:[a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border/60 font-medium text-spur-text",children:["role: ",a.jsx("strong",{className:"font-semibold",children:e.role})]}),e.skill&&a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border/40 font-mono text-[10px] text-spur-text-muted",title:`Reasoning skill: ${e.skill}`,children:e.skill})]}),a.jsxs("div",{className:"mt-2.5",children:[a.jsxs("div",{className:"text-[10px] uppercase tracking-wider text-spur-text-muted font-medium mb-1 flex items-center justify-between",children:[a.jsx("span",{children:"Executors"}),a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted/70",children:[r.length," in tier"]})]}),a.jsx("div",{className:"flex flex-wrap gap-1","data-stage-executors":e.id,children:r.length>0?r.map(s=>a.jsx(qv,{cand:s,kind:"stage"},s.name)):a.jsx("span",{className:"text-[11px] font-mono text-spur-text-muted italic",children:"none in tier"})})]})]})})}function oV({executor:e,onToggle:t}){const n=e.executionCapabilities?.axes,r=n?Object.keys(n).filter(o=>n[o]?.state==="available"||n[o]?.state==="enforced"):[],s=!e.disabled,i=Wv(e);return a.jsxs("div",{className:"p-3.5 bg-spur-surface border border-spur-border rounded-xl flex flex-col justify-between gap-3 hover:border-spur-accent/40 transition-colors shadow-sm","data-executor-card":e.name,children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"font-mono font-semibold text-sm text-spur-text",children:e.name}),a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border/60 text-[11px] font-mono text-spur-accent",children:e.agent})]}),a.jsx("span",{className:`text-[11px] font-mono px-2 py-0.5 rounded-md font-medium ${ox(e.tier)}`,children:e.tier})]}),a.jsxs("div",{className:"mt-2 text-xs flex flex-wrap items-center justify-between gap-1",children:[a.jsxs("div",{className:"flex items-center gap-1.5 truncate",children:[a.jsx("span",{className:"text-spur-text-muted",children:"model:"}),a.jsx("span",{className:"font-mono text-spur-text truncate",children:e.model??"default"})]}),e.version&&a.jsx("span",{className:"text-[10px] font-mono text-spur-text-muted/80 bg-spur-surface-2 px-1.5 py-0.5 rounded",children:e.version})]}),e.elected&&e.elected.length>0&&a.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-1",children:[a.jsx("span",{className:"text-[10px] text-amber-700 dark:text-amber-400 font-medium",children:"Elected:"}),e.elected.map(o=>a.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[10px] font-mono text-amber-800 dark:text-amber-300 flex items-center gap-0.5",children:[a.jsx("span",{children:"⭐"}),a.jsx("span",{children:o})]},o))]}),r.length>0&&a.jsx("div",{className:"mt-2 flex flex-wrap gap-1",children:r.map(o=>a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border/40 text-[10px] font-mono text-spur-text-muted",children:o},o))})]}),a.jsxs("div",{className:"pt-2 border-t border-spur-border/40 flex items-center justify-between text-xs gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsxs("button",{type:"button",role:"switch","aria-checked":s,"aria-label":`Toggle ${e.name} status (currently ${s?"Ready":"Disabled"})`,onClick:o=>{o.stopPropagation(),t?.(e)},className:`group relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-spur-accent focus:ring-offset-1 focus:ring-offset-spur-surface ${s?"bg-emerald-500 border-emerald-500":"bg-spur-surface-3 border-spur-border"}`,"data-executor-toggle":e.name,children:[a.jsxs("span",{className:"sr-only",children:["Toggle ",e.name," availability"]}),a.jsx("span",{"aria-hidden":"true",className:`pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow-sm ring-0 transition duration-200 ease-in-out ${s?"translate-x-4":"translate-x-0 bg-spur-text-muted/80"}`})]}),a.jsx("span",{className:`font-mono text-xs font-medium ${e.disabled?"text-amber-400":e.installed===!1?"text-rose-400":"text-emerald-400"}`,children:e.disabled?"Disabled":e.installed===!1?"CLI Missing":"Ready"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.sourceLayer&&a.jsx("span",{className:"px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border/60 text-[10px] font-mono text-spur-text-muted",title:`Declared in ${e.sourceLayer==="project"?"Project Config":"Global Config"}: ${i}`,children:e.sourceLayer}),e.disabled&&a.jsx("span",{className:"text-[11px] text-spur-text-muted truncate max-w-[120px]",title:e.disabledReason??e.disabledOwner??"disabled",children:e.disabledReason??e.disabledOwner??"disabled"})]})]})]})}function lV({entry:e,orchestratorOffline:t,onOpen:n}){const r=nV(e,t),s=e.observed.status==="running"?Vq(e.observed.startedAt):null;return a.jsxs("button",{type:"button",className:"text-left p-3.5 bg-spur-surface border border-spur-border rounded-xl hover:bg-spur-surface-2/60 focus:outline-none focus:ring-1 focus:ring-spur-accent shadow-sm transition-colors","data-roster-entry":e.instanceId,"data-g6":"open-member","aria-haspopup":"dialog",onClick:i=>n(e,i.currentTarget),children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{"data-roster-role":!0,className:"font-medium text-spur-text text-sm",children:e.declared?.role??"member"}),e.isOrchestrator&&a.jsx("span",{"data-roster-orchestrator":!0,className:"text-xs px-1 rounded bg-spur-accent/20 text-spur-accent",children:"orchestrator"})]}),a.jsxs("div",{className:"mt-1 text-xs text-spur-text-muted",children:["executor"," ",a.jsx("span",{"data-roster-executor":!0,className:"font-mono text-spur-text",children:e.declared?.executor??"—"})]}),a.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-xs",children:[a.jsxs("span",{"data-roster-declared":!0,children:[a.jsx("span",{className:"text-spur-text-muted",children:"declared:"})," ",a.jsx("span",{className:"text-spur-text",children:e.declared===null?"none":`${e.declared.enabled?"enabled":"disabled"} · capability ${e.declared.capabilityState}`})]}),a.jsxs("span",{"data-roster-observed":!0,children:[a.jsx("span",{className:"text-spur-text-muted",children:"observed:"})," ",a.jsxs("span",{className:"text-spur-text",children:[e.observed.status,e.observed.pid!==null?` — pid ${e.observed.pid}`:"",e.observed.exitCode!==null?` — exit ${e.observed.exitCode}`:""]})]})]}),s!==null&&a.jsx("div",{"data-roster-uptime":!0,className:"mt-1 text-xs text-spur-text-muted",children:s}),a.jsxs("div",{"data-roster-session":!0,className:"mt-1 text-xs text-spur-text-muted",children:["session"," ",a.jsx("span",{className:"font-mono text-spur-text",children:$v(e.observed.session??e.declared?.session)??"—"})]}),e.issues.length>0&&a.jsx("div",{className:"mt-1 space-y-0.5",children:e.issues.map(i=>a.jsxs("div",{"data-roster-issue":i,className:"text-xs",children:[a.jsx("span",{"aria-hidden":"true",children:Jc[i].icon})," ",a.jsx("span",{className:"text-spur-text",children:Jc[i].label}),a.jsxs("span",{className:"text-spur-text-muted",children:[" — ",Jc[i].action]})]},i))}),r.action!==null&&a.jsxs("div",{"data-roster-next-action":!0,className:"mt-1 text-xs text-spur-text-muted",children:["next: ",r.action]})]})}function uV({executor:e,targetDisabled:t,onClose:n,onSuccess:r}){const[s,i]=g.useState(!1),[o,l]=g.useState(null);g.useEffect(()=>{const p=f=>{f.key==="Escape"&&!s&&n()};return window.addEventListener("keydown",p),()=>window.removeEventListener("keydown",p)},[n,s]);const u=async()=>{i(!0),l(null);try{const p=await Ge(new Request(Jq(),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e.name,disabled:t,layer:e.sourceLayer})}));if(!p.ok){const f=await p.json().catch(()=>({}));throw new Error(f.error??`Request failed with status ${p.status}`)}r()}catch(p){l(p instanceof Error?p.message:String(p)),i(!1)}},c=e.sourceLayer==="project"?"Project Config":"Global Config",d=Wv(e);return a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm","data-modal-backdrop":!0,children:[a.jsx("button",{type:"button","aria-label":"Close modal backdrop",tabIndex:-1,className:"fixed inset-0 w-full h-full bg-transparent border-0 cursor-default",onClick:s?void 0:n}),a.jsxs("div",{className:"relative z-10 w-full max-w-md p-6 bg-spur-surface border border-spur-border rounded-2xl shadow-2xl space-y-4 text-spur-text",role:"dialog","aria-modal":"true","aria-labelledby":"executor-modal-title","data-executor-confirm-modal":!0,children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:`p-2.5 rounded-xl text-lg flex items-center justify-center ${t?"bg-amber-500/10 text-amber-400 border border-amber-500/20":"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20"}`,"aria-hidden":"true",children:t?"⏸️":"⚡"}),a.jsxs("div",{children:[a.jsx("h3",{id:"executor-modal-title",className:"text-base font-semibold text-spur-text",children:t?"Disable Agent Executor":"Enable Agent Executor"}),a.jsxs("p",{className:"text-xs text-spur-text-muted mt-0.5",children:["Are you sure you want to change the status of"," ",a.jsx("code",{className:"px-1.5 py-0.5 rounded bg-spur-surface-2 border border-spur-border font-mono text-spur-accent font-semibold",children:e.name}),"?"]})]})]}),a.jsxs("div",{className:"p-3.5 rounded-xl bg-spur-surface-2 border border-spur-border/60 space-y-2.5 text-xs",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-spur-text-muted",children:"Target configuration:"}),a.jsx("span",{className:"font-mono font-medium text-spur-text",children:c})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("span",{className:"text-spur-text-muted shrink-0",children:"Config file:"}),a.jsx("code",{className:"font-mono text-spur-accent text-[11px] truncate max-w-[230px]",title:d,children:d})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-spur-text-muted",children:"Status transition:"}),a.jsxs("div",{className:"flex items-center gap-1.5 font-mono text-xs",children:[a.jsx("span",{className:e.disabled?"text-amber-400":"text-emerald-400",children:e.disabled?"Disabled":"Ready"}),a.jsx("span",{className:"text-spur-text-muted",children:"→"}),a.jsx("span",{className:`font-semibold ${t?"text-amber-400":"text-emerald-400"}`,children:t?"Disabled (OFF)":"Ready (ON)"})]})]}),a.jsx("div",{className:"pt-2 border-t border-spur-border/40 text-[11px] text-spur-text-muted leading-relaxed",children:t?a.jsxs("span",{children:["⚠️ Disabling will update your ",c.toLowerCase()," and exclude this executor from role elections and execution pipelines."]}):a.jsxs("span",{children:["✨ Enabling will update your ",c.toLowerCase()," and make this executor eligible for role elections and execution pipelines."]})})]}),o&&a.jsx("div",{className:"p-3 rounded-xl bg-rose-500/10 border border-rose-500/20 text-rose-400 text-xs",children:o}),a.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[a.jsx("button",{type:"button",onClick:n,disabled:s,className:"px-4 py-2 text-xs font-medium rounded-xl border border-spur-border bg-spur-surface-2 hover:bg-spur-surface-3 text-spur-text transition-colors disabled:opacity-50","data-modal-cancel":!0,children:"Cancel"}),a.jsx("button",{type:"button",onClick:u,disabled:s,className:`px-4 py-2 text-xs font-medium rounded-xl border transition-colors flex items-center gap-1.5 disabled:opacity-50 ${t?"bg-amber-500/20 hover:bg-amber-500/30 text-amber-300 border-amber-500/40":"bg-emerald-500/20 hover:bg-emerald-500/30 text-emerald-300 border-emerald-500/40"}`,"data-modal-confirm":!0,children:s?a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin"}),a.jsx("span",{children:"Updating..."})]}):a.jsx("span",{children:t?"Confirm Disable":"Confirm Enable"})})]})]})]})}function ed(e){let t=!1,n=!1;for(let r=0;r<e.length;r++){const s=e[r];if(s==="'"&&!n)t=!t;else if(s==='"'&&!t&&(r===0||(e[r-1]??"")!=="\\"))n=!n;else if(s==="#"&&!t&&!n&&(r===0||/\s/.test(e[r-1]??"")))return{content:e.slice(0,r),comment:e.slice(r)}}return{content:e}}function td(e,t){if(!e)return null;const n=e.trim();if(!n)return e;const r=e.match(/^\s*/),s=e.match(/\s*$/),i=r?r[0]:"",o=s?s[0]:"";let l=n;return n.startsWith('"')&&n.endsWith('"')&&n.length>=2||n.startsWith("'")&&n.endsWith("'")&&n.length>=2?l=a.jsx("span",{className:"text-emerald-400",children:n}):/^(true|false|yes|no|null|~)$/i.test(n)?l=a.jsx("span",{className:"text-purple-400 font-semibold",children:n}):/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/.test(n)?l=a.jsx("span",{className:"text-amber-400 font-mono",children:n}):/^[&*][a-zA-Z0-9_-]+$/.test(n)?l=a.jsx("span",{className:"text-pink-400 font-semibold",children:n}):/^[|>][+-]?$/.test(n)?l=a.jsx("span",{className:"text-amber-300 font-bold",children:n}):/^!{1,2}[a-zA-Z0-9_-]+$/.test(n)?l=a.jsx("span",{className:"text-indigo-400 font-mono",children:n}):l=a.jsx("span",{className:"text-slate-200",children:n}),a.jsxs("span",{children:[i,l,o]},t)}function cV(e,t){const n=`line-${t}`;if(e.length===0)return" ";if(/^\s*(?:---|(?:\.\.\.))\s*$/.test(e))return a.jsx("span",{className:"text-slate-500 font-bold",children:e},n);const r=e.trimStart();if(r.startsWith("#")){const u=e.slice(0,e.length-r.length);return a.jsxs("span",{children:[u,a.jsx("span",{className:"text-slate-500 italic",children:r})]},n)}const s=e.match(/^(\s*(?:-\s+)?)(['"]?[a-zA-Z0-9_\-./@]+['"]?)\s*:(.*)$/);if(s){const u=s[1]??"",c=s[2]??"",d=s[3]??"",p=u.match(/^(\s*)(-\s+)(.*)$/);let f=u;p&&(f=a.jsxs("span",{children:[p[1],a.jsx("span",{className:"text-rose-400 font-bold",children:p[2]}),p[3]]}));const{content:m,comment:b}=ed(d);return a.jsxs("span",{children:[f,a.jsx("span",{className:"text-sky-400 font-semibold",children:c}),a.jsx("span",{className:"text-slate-400",children:":"}),m?td(m,`${n}-val`):null,b?a.jsx("span",{className:"text-slate-500 italic",children:b}):null]},n)}const i=e.match(/^(\s*-\s+)(.*)$/);if(i){const u=i[1]??"",c=i[2]??"",{content:d,comment:p}=ed(c),f=u.match(/^(\s*)(-\s+)/),m=f?a.jsxs("span",{children:[f[1],a.jsx("span",{className:"text-rose-400 font-bold",children:f[2]})]}):a.jsx("span",{className:"text-rose-400 font-bold",children:u});return a.jsxs("span",{children:[m,d?td(d,`${n}-val`):null,p?a.jsx("span",{className:"text-slate-500 italic",children:p}):null]},n)}const{content:o,comment:l}=ed(e);return a.jsxs("span",{children:[o?td(o,`${n}-val`):null,l?a.jsx("span",{className:"text-slate-500 italic",children:l}):null]},n)}function lx({code:e="",filePath:t,maxHeight:n="calc(100vh - 280px)",className:r="",hideToolbar:s=!1}){const[i,o]=g.useState(!1),l=g.useMemo(()=>(e??"").split(`
|
|
@@ -318,5 +318,5 @@ ${w}
|
|
|
318
318
|
To pick up a draggable item, press the space bar.
|
|
319
319
|
While dragging, use the arrow keys to move the item.
|
|
320
320
|
Press space again to drop the item in its new position, or press escape to cancel.
|
|
321
|
-
`},OV={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function LV(e){let{announcements:t=OV,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=DV}=e;const{announce:i,announcement:o}=CV(),l=Gu("DndLiveRegion"),[u,c]=g.useState(!1);if(g.useEffect(()=>{c(!0)},[]),IV(g.useMemo(()=>({onDragStart(p){let{active:f}=p;i(t.onDragStart({active:f}))},onDragMove(p){let{active:f,over:m}=p;t.onDragMove&&i(t.onDragMove({active:f,over:m}))},onDragOver(p){let{active:f,over:m}=p;i(t.onDragOver({active:f,over:m}))},onDragEnd(p){let{active:f,over:m}=p;i(t.onDragEnd({active:f,over:m}))},onDragCancel(p){let{active:f,over:m}=p;i(t.onDragCancel({active:f,over:m}))}}),[i,t])),!u)return null;const d=Ve.createElement(Ve.Fragment,null,Ve.createElement(kV,{id:r,value:s.draggable}),Ve.createElement(_V,{id:l,announcement:o}));return n?Or.createPortal(d,n):d}var Yt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yt||(Yt={}));function Ul(){}function l1(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function jV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Vn=Object.freeze({x:0,y:0});function MV(e,t){const n=Bl(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function FV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function PV(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function BV(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-r,l=i-n;if(r<s&&n<i){const u=t.width*t.height,c=e.width*e.height,d=o*l,p=d/(u+c-d);return Number(p.toFixed(4))}return 0}const UV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:o}=i,l=n.get(o);if(l){const u=BV(l,t);u>0&&s.push({id:o,data:{droppableContainer:i,value:u}})}}return s.sort(FV)};function $V(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function eA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Vn}function zV(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,l)=>({...o,top:o.top+e*l.y,bottom:o.bottom+e*l.y,left:o.left+e*l.x,right:o.right+e*l.x}),{...n})}}const HV=zV(1);function tA(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function GV(e,t,n){const r=tA(t);if(!r)return e;const{scaleX:s,scaleY:i,x:o,y:l}=r,u=e.left-o-(1-s)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?e.width/s:e.width,p=i?e.height/i:e.height;return{width:d,height:p,top:c,right:u+d,bottom:c+p,left:u}}const WV={ignoreTransform:!1};function lo(e,t){t===void 0&&(t=WV);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Tn(e).getComputedStyle(e);c&&(n=GV(n,c,d))}const{top:r,left:s,width:i,height:o,bottom:l,right:u}=n;return{top:r,left:s,width:i,height:o,bottom:l,right:u}}function u1(e){return lo(e,{ignoreTransform:!0})}function qV(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function VV(e,t){return t===void 0&&(t=Tn(e).getComputedStyle(e)),t.position==="fixed"}function YV(e,t){t===void 0&&(t=Tn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function px(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(cx(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!io(s)||Xv(s)||n.includes(s))return n;const i=Tn(e).getComputedStyle(s);return s!==e&&YV(s,i)&&n.push(s),VV(s,i)?n:r(s.parentNode)}return e?r(e):n}function nA(e){const[t]=px(e,1);return t??null}function rd(e){return!zu||!e?null:Ca(e)?e:ux(e)?cx(e)||e===Ia(e).scrollingElement?window:io(e)?e:null:null}function rA(e){return Ca(e)?e.scrollX:e.scrollLeft}function sA(e){return Ca(e)?e.scrollY:e.scrollTop}function tp(e){return{x:rA(e),y:sA(e)}}var tn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tn||(tn={}));function aA(e){return!zu||!e?!1:e===document.scrollingElement}function iA(e){const t={x:0,y:0},n=aA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:l,maxScroll:r,minScroll:t}}const KV={x:.2,y:.2};function ZV(e,t,n,r,s){let{top:i,left:o,right:l,bottom:u}=n;r===void 0&&(r=10),s===void 0&&(s=KV);const{isTop:c,isBottom:d,isLeft:p,isRight:f}=iA(e),m={x:0,y:0},b={x:0,y:0},x={height:t.height*s.y,width:t.width*s.x};return!c&&i<=t.top+x.height?(m.y=tn.Backward,b.y=r*Math.abs((t.top+x.height-i)/x.height)):!d&&u>=t.bottom-x.height&&(m.y=tn.Forward,b.y=r*Math.abs((t.bottom-x.height-u)/x.height)),!f&&l>=t.right-x.width?(m.x=tn.Forward,b.x=r*Math.abs((t.right-x.width-l)/x.width)):!p&&o<=t.left+x.width&&(m.x=tn.Backward,b.x=r*Math.abs((t.left+x.width-o)/x.width)),{direction:m,speed:b}}function XV(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function oA(e){return e.reduce((t,n)=>Js(t,tp(n)),Vn)}function QV(e){return e.reduce((t,n)=>t+rA(n),0)}function JV(e){return e.reduce((t,n)=>t+sA(n),0)}function lA(e,t){if(t===void 0&&(t=lo),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);nA(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const eY=[["x",["left","right"],QV],["y",["top","bottom"],JV]];class fx{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=px(n),s=oA(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,l]of eY)for(const u of o)Object.defineProperty(this,u,{get:()=>{const c=l(r),d=s[i]-c;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mi{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function tY(e){const{EventTarget:t}=Tn(e);return e instanceof t?e:Ia(e)}function sd(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ln;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ln||(Ln={}));function c1(e){e.preventDefault()}function nY(e){e.stopPropagation()}var St;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(St||(St={}));const uA={start:[St.Space,St.Enter],cancel:[St.Esc],end:[St.Space,St.Enter,St.Tab]},rY=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case St.Right:return{...n,x:n.x+25};case St.Left:return{...n,x:n.x-25};case St.Down:return{...n,y:n.y+25};case St.Up:return{...n,y:n.y-25}}};class mx{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new mi(Ia(n)),this.windowListeners=new mi(Tn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ln.Resize,this.handleCancel),this.windowListeners.add(Ln.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ln.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&lA(r),n(Vn)}handleKeyDown(t){if(dx(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=uA,coordinateGetter:o=rY,scrollBehavior:l="smooth"}=s,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:Vn;this.referenceCoordinates||(this.referenceCoordinates=d);const p=o(t,{active:n,context:r.current,currentCoordinates:d});if(p){const f=Pl(p,d),m={x:0,y:0},{scrollableAncestors:b}=r.current;for(const x of b){const y=t.code,{isTop:E,isRight:v,isLeft:S,isBottom:A,maxScroll:N,minScroll:T}=iA(x),w=XV(x),k={x:Math.min(y===St.Right?w.right-w.width/2:w.right,Math.max(y===St.Right?w.left:w.left+w.width/2,p.x)),y:Math.min(y===St.Down?w.bottom-w.height/2:w.bottom,Math.max(y===St.Down?w.top:w.top+w.height/2,p.y))},F=y===St.Right&&!v||y===St.Left&&!S,C=y===St.Down&&!A||y===St.Up&&!E;if(F&&k.x!==p.x){const $=x.scrollLeft+f.x,z=y===St.Right&&$<=N.x||y===St.Left&&$>=T.x;if(z&&!f.y){x.scrollTo({left:$,behavior:l});return}z?m.x=x.scrollLeft-$:m.x=y===St.Right?x.scrollLeft-N.x:x.scrollLeft-T.x,m.x&&x.scrollBy({left:-m.x,behavior:l});break}else if(C&&k.y!==p.y){const $=x.scrollTop+f.y,z=y===St.Down&&$<=N.y||y===St.Up&&$>=T.y;if(z&&!f.x){x.scrollTo({top:$,behavior:l});return}z?m.y=x.scrollTop-$:m.y=y===St.Down?x.scrollTop-N.y:x.scrollTop-T.y,m.y&&x.scrollBy({top:-m.y,behavior:l});break}}this.handleMove(t,Js(Pl(p,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}mx.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=uA,onActivation:s}=t,{active:i}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function d1(e){return!!(e&&"distance"in e)}function p1(e){return!!(e&&"delay"in e)}class hx{constructor(t,n,r){var s;r===void 0&&(r=tY(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:o}=i;this.props=t,this.events=n,this.document=Ia(o),this.documentListeners=new mi(this.document),this.listeners=new mi(r),this.windowListeners=new mi(Tn(o)),this.initialCoordinates=(s=Bl(i))!=null?s:Vn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ln.Resize,this.handleCancel),this.windowListeners.add(Ln.DragStart,c1),this.windowListeners.add(Ln.VisibilityChange,this.handleCancel),this.windowListeners.add(Ln.ContextMenu,c1),this.documentListeners.add(Ln.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(p1(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(d1(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ln.Click,nY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ln.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:l}}=i;if(!s)return;const u=(n=Bl(t))!=null?n:Vn,c=Pl(s,u);if(!r&&l){if(d1(l)){if(l.tolerance!=null&&sd(c,l.tolerance))return this.handleCancel();if(sd(c,l.distance))return this.handleStart()}if(p1(l)&&sd(c,l.tolerance))return this.handleCancel();this.handlePending(l,c);return}t.cancelable&&t.preventDefault(),o(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===St.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const sY={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class gx extends hx{constructor(t){const{event:n}=t,r=Ia(n.target);super(t,sY,r)}}gx.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const aY={move:{name:"mousemove"},end:{name:"mouseup"}};var np;(function(e){e[e.RightClick=2]="RightClick"})(np||(np={}));class iY extends hx{constructor(t){super(t,aY,Ia(t.event.target))}}iY.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===np.RightClick?!1:(r?.({event:n}),!0)}}];const ad={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class oY extends hx{constructor(t){super(t,ad)}static setup(){return window.addEventListener(ad.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ad.move.name,t)};function t(){}}}oY.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var hi;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(hi||(hi={}));var $l;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})($l||($l={}));function lY(e){let{acceleration:t,activator:n=hi.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:l=$l.TreeOrder,pointerCoordinates:u,scrollableAncestors:c,scrollableAncestorRects:d,delta:p,threshold:f}=e;const m=cY({delta:p,disabled:!i}),[b,x]=TV(),y=g.useRef({x:0,y:0}),E=g.useRef({x:0,y:0}),v=g.useMemo(()=>{switch(n){case hi.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case hi.DraggableRect:return s}},[n,s,u]),S=g.useRef(null),A=g.useCallback(()=>{const T=S.current;if(!T)return;const w=y.current.x*E.current.x,k=y.current.y*E.current.y;T.scrollBy(w,k)},[]),N=g.useMemo(()=>l===$l.TreeOrder?[...c].reverse():c,[l,c]);g.useEffect(()=>{if(!i||!c.length||!v){x();return}for(const T of N){if(r?.(T)===!1)continue;const w=c.indexOf(T),k=d[w];if(!k)continue;const{direction:F,speed:C}=ZV(T,k,v,t,f);for(const $ of["x","y"])m[$][F[$]]||(C[$]=0,F[$]=0);if(C.x>0||C.y>0){x(),S.current=T,b(A,o),y.current=C,E.current=F;return}}y.current={x:0,y:0},E.current={x:0,y:0},x()},[t,A,r,x,i,o,JSON.stringify(v),JSON.stringify(m),b,c,N,d,JSON.stringify(f)])}const uY={x:{[tn.Backward]:!1,[tn.Forward]:!1},y:{[tn.Backward]:!1,[tn.Forward]:!1}};function cY(e){let{delta:t,disabled:n}=e;const r=Fl(t);return oo(s=>{if(n||!r||!s)return uY;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[tn.Backward]:s.x[tn.Backward]||i.x===-1,[tn.Forward]:s.x[tn.Forward]||i.x===1},y:{[tn.Backward]:s.y[tn.Backward]||i.y===-1,[tn.Forward]:s.y[tn.Forward]||i.y===1}}},[n,t,r])}function dY(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return oo(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function pY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...i]},[]),[e,t])}var Mi;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Mi||(Mi={}));var rp;(function(e){e.Optimized="optimized"})(rp||(rp={}));const f1=new Map;function fY(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,o]=g.useState(null),{frequency:l,measure:u,strategy:c}=s,d=g.useRef(e),p=y(),f=ji(p),m=g.useCallback(function(E){E===void 0&&(E=[]),!f.current&&o(v=>v===null?E:v.concat(E.filter(S=>!v.includes(S))))},[f]),b=g.useRef(null),x=oo(E=>{if(p&&!n)return f1;if(!E||E===f1||d.current!==e||i!=null){const v=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){v.set(S.id,S.rect.current);continue}const A=S.node.current,N=A?new fx(u(A),A):null;S.rect.current=N,N&&v.set(S.id,N)}return v}return E},[e,i,n,p,u]);return g.useEffect(()=>{d.current=e},[e]),g.useEffect(()=>{p||m()},[n,p]),g.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),g.useEffect(()=>{p||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{m(),b.current=null},l))},[l,p,m,...r]),{droppableRects:x,measureDroppableContainers:m,measuringScheduled:i!=null};function y(){switch(c){case Mi.Always:return!1;case Mi.BeforeDragging:return n;default:return!n}}}function bx(e,t){return oo(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function mY(e,t){return bx(e,t)}function hY(e){let{callback:t,disabled:n}=e;const r=Hu(t),s=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return g.useEffect(()=>()=>s?.disconnect(),[s]),s}function Wu(e){let{callback:t,disabled:n}=e;const r=Hu(t),s=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return g.useEffect(()=>()=>s?.disconnect(),[s]),s}function gY(e){return new fx(lo(e),e)}function m1(e,t,n){t===void 0&&(t=gY);const[r,s]=g.useState(null);function i(){s(u=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=u??n)!=null?c:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d})}const o=hY({callback(u){if(e)for(const c of u){const{type:d,target:p}=c;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){i();break}}}}),l=Wu({callback:i});return Tr(()=>{i(),e?(l?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),o?.disconnect())},[e]),r}function bY(e){const t=bx(e);return eA(e,t)}const h1=[];function xY(e){const t=g.useRef(e),n=oo(r=>e?r&&r!==h1&&e&&t.current&&e.parentNode===t.current.parentNode?r:px(e):h1,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function yY(e){const[t,n]=g.useState(null),r=g.useRef(e),s=g.useCallback(i=>{const o=rd(i.target);o&&n(l=>l?(l.set(o,tp(o)),new Map(l)):null)},[]);return g.useEffect(()=>{const i=r.current;if(e!==i){o(i);const l=e.map(u=>{const c=rd(u);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,tp(c)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{o(e),o(i)};function o(l){l.forEach(u=>{const c=rd(u);c?.removeEventListener("scroll",s)})}},[s,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>Js(i,o),Vn):oA(e):Vn,[e,t])}function g1(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==Vn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Pl(e,n.current):Vn}function EY(e){g.useEffect(()=>{if(!zu)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function SY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,t)},n},{}),[e,t])}function cA(e){return g.useMemo(()=>e?qV(e):null,[e])}const b1=[];function TY(e,t){t===void 0&&(t=lo);const[n]=e,r=cA(n?Tn(n):null),[s,i]=g.useState(b1);function o(){i(()=>e.length?e.map(u=>aA(u)?r:new fx(t(u),u)):b1)}const l=Wu({callback:o});return Tr(()=>{l?.disconnect(),o(),e.forEach(u=>l?.observe(u))},[e]),s}function dA(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return io(t)?t:e}function NY(e){let{measure:t}=e;const[n,r]=g.useState(null),s=g.useCallback(c=>{for(const{target:d}of c)if(io(d)){r(p=>{const f=t(d);return p?{...p,width:f.width,height:f.height}:f});break}},[t]),i=Wu({callback:s}),o=g.useCallback(c=>{const d=dA(c);i?.disconnect(),d&&i?.observe(d),r(d?t(d):null)},[t,i]),[l,u]=Ml(o);return g.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const wY=[{sensor:gx,options:{}},{sensor:mx,options:{}}],vY={current:{}},ll={draggable:{measure:u1},droppable:{measure:u1,strategy:Mi.WhileDragging,frequency:rp.Optimized},dragOverlay:{measure:lo}};class gi extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const AY={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new gi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ul},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ll,measureDroppableContainers:Ul,windowRect:null,measuringScheduled:!1},pA={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ul,draggableNodes:new Map,over:null,measureDroppableContainers:Ul},uo=g.createContext(pA),fA=g.createContext(AY);function kY(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new gi}}}function _Y(e,t){switch(t.type){case Yt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Yt.DragEnd:case Yt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yt.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new gi(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Yt.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new gi(e.droppable.containers);return o.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case Yt.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new gi(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function CY(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=g.useContext(uo),i=Fl(r),o=Fl(n?.id);return g.useEffect(()=>{if(!t&&!r&&i&&o!=null){if(!dx(i)||document.activeElement===i.target)return;const l=s.get(o);if(!l)return;const{activatorNode:u,node:c}=l;if(!u.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[u.current,c.current]){if(!d)continue;const p=vV(d);if(p){p.focus();break}}})}},[r,t,s,o,i]),null}function mA(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function IY(e){return g.useMemo(()=>({draggable:{...ll.draggable,...e?.draggable},droppable:{...ll.droppable,...e?.droppable},dragOverlay:{...ll.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function RY(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=g.useRef(!1),{x:o,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Tr(()=>{if(!o&&!l||!t){i.current=!1;return}if(i.current||!r)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=n(c),p=eA(d,r);if(o||(p.x=0),l||(p.y=0),i.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const f=nA(c);f&&f.scrollBy({top:p.y,left:p.x})}},[t,o,l,r,n])}const qu=g.createContext({...Vn,scaleX:1,scaleY:1});var Rr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rr||(Rr={}));const DY=g.memo(function(t){var n,r,s,i;let{id:o,accessibility:l,autoScroll:u=!0,children:c,sensors:d=wY,collisionDetection:p=UV,measuring:f,modifiers:m,...b}=t;const x=g.useReducer(_Y,void 0,kY),[y,E]=x,[v,S]=RV(),[A,N]=g.useState(Rr.Uninitialized),T=A===Rr.Initialized,{draggable:{active:w,nodes:k,translate:F},droppable:{containers:C}}=y,$=w!=null?k.get(w):null,z=g.useRef({initial:null,translated:null}),M=g.useMemo(()=>{var ve;return w!=null?{id:w,data:(ve=$?.data)!=null?ve:vY,rect:z}:null},[w,$]),G=g.useRef(null),[H,j]=g.useState(null),[q,re]=g.useState(null),pe=ji(b,Object.values(b)),I=Gu("DndDescribedBy",o),Z=g.useMemo(()=>C.getEnabled(),[C]),ie=IY(f),{droppableRects:L,measureDroppableContainers:Ee,measuringScheduled:fe}=fY(Z,{dragging:T,dependencies:[F.x,F.y],config:ie.droppable}),Y=dY(k,w),me=g.useMemo(()=>q?Bl(q):null,[q]),te=Ft(),O=mY(Y,ie.draggable.measure);RY({activeNode:w!=null?k.get(w):null,config:te.layoutShiftCompensation,initialRect:O,measure:ie.draggable.measure});const he=m1(Y,ie.draggable.measure,O),be=m1(Y?Y.parentElement:null),ye=g.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:C,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),we=C.getNodeFor((n=ye.current.over)==null?void 0:n.id),Pe=NY({measure:ie.dragOverlay.measure}),ue=(r=Pe.nodeRef.current)!=null?r:Y,Ye=T?(s=Pe.rect)!=null?s:he:null,at=!!(Pe.nodeRef.current&&Pe.rect),Qe=bY(at?null:he),At=cA(ue?Tn(ue):null),ft=xY(T?we??Y:null),dt=TY(ft),Ot=mA(m,{transform:{x:F.x-Qe.x,y:F.y-Qe.y,scaleX:1,scaleY:1},activatorEvent:q,active:M,activeNodeRect:he,containerNodeRect:be,draggingNodeRect:Ye,over:ye.current.over,overlayNodeRect:Pe.rect,scrollableAncestors:ft,scrollableAncestorRects:dt,windowRect:At}),qe=me?Js(me,F):null,De=yY(ft),Ke=g1(De),Q=g1(De,[he]),le=Js(Ot,Ke),Ae=Ye?HV(Ye,Ot):null,W=M&&Ae?p({active:M,collisionRect:Ae,droppableRects:L,droppableContainers:Z,pointerCoordinates:qe}):null,_e=PV(W,"id"),[Be,ut]=g.useState(null),mt=at?Ot:Js(Ot,Q),kt=$V(mt,(i=Be?.rect)!=null?i:null,he),yt=g.useRef(null),oe=g.useCallback((ve,He)=>{let{sensor:$e,options:bt}=He;if(G.current==null)return;const ne=k.get(G.current);if(!ne)return;const de=ve.nativeEvent,st=new $e({active:G.current,activeNode:ne,event:de,options:bt,context:ye,onAbort(V){if(!k.get(V))return;const{onDragAbort:Ze}=pe.current,pt={id:V};Ze?.(pt),v({type:"onDragAbort",event:pt})},onPending(V,Me,Ze,pt){if(!k.get(V))return;const{onDragPending:pr}=pe.current,Qn={id:V,constraint:Me,initialCoordinates:Ze,offset:pt};pr?.(Qn),v({type:"onDragPending",event:Qn})},onStart(V){const Me=G.current;if(Me==null)return;const Ze=k.get(Me);if(!Ze)return;const{onDragStart:pt}=pe.current,_n={activatorEvent:de,active:{id:Me,data:Ze.data,rect:z}};Or.unstable_batchedUpdates(()=>{pt?.(_n),N(Rr.Initializing),E({type:Yt.DragStart,initialCoordinates:V,active:Me}),v({type:"onDragStart",event:_n}),j(yt.current),re(de)})},onMove(V){E({type:Yt.DragMove,coordinates:V})},onEnd:wt(Yt.DragEnd),onCancel:wt(Yt.DragCancel)});yt.current=st;function wt(V){return async function(){const{active:Ze,collisions:pt,over:_n,scrollAdjustedTranslate:pr}=ye.current;let Qn=null;if(Ze&&pr){const{cancelDrop:zn}=pe.current;Qn={activatorEvent:de,active:Ze,collisions:pt,delta:pr,over:_n},V===Yt.DragEnd&&typeof zn=="function"&&await Promise.resolve(zn(Qn))&&(V=Yt.DragCancel)}G.current=null,Or.unstable_batchedUpdates(()=>{E({type:V}),N(Rr.Uninitialized),ut(null),j(null),re(null),yt.current=null;const zn=V===Yt.DragEnd?"onDragEnd":"onDragCancel";if(Qn){const Ra=pe.current[zn];Ra?.(Qn),v({type:zn,event:Qn})}})}}},[k]),Ne=g.useCallback((ve,He)=>($e,bt)=>{const ne=$e.nativeEvent,de=k.get(bt);if(G.current!==null||!de||ne.dndKit||ne.defaultPrevented)return;const st={active:de};ve($e,He.options,st)===!0&&(ne.dndKit={capturedBy:He.sensor},G.current=bt,oe($e,He))},[k,oe]),je=pY(d,Ne);EY(d),Tr(()=>{he&&A===Rr.Initializing&&N(Rr.Initialized)},[he,A]),g.useEffect(()=>{const{onDragMove:ve}=pe.current,{active:He,activatorEvent:$e,collisions:bt,over:ne}=ye.current;if(!He||!$e)return;const de={active:He,activatorEvent:$e,collisions:bt,delta:{x:le.x,y:le.y},over:ne};Or.unstable_batchedUpdates(()=>{ve?.(de),v({type:"onDragMove",event:de})})},[le.x,le.y]),g.useEffect(()=>{const{active:ve,activatorEvent:He,collisions:$e,droppableContainers:bt,scrollAdjustedTranslate:ne}=ye.current;if(!ve||G.current==null||!He||!ne)return;const{onDragOver:de}=pe.current,st=bt.get(_e),wt=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,V={active:ve,activatorEvent:He,collisions:$e,delta:{x:ne.x,y:ne.y},over:wt};Or.unstable_batchedUpdates(()=>{ut(wt),de?.(V),v({type:"onDragOver",event:V})})},[_e]),Tr(()=>{ye.current={activatorEvent:q,active:M,activeNode:Y,collisionRect:Ae,collisions:W,droppableRects:L,draggableNodes:k,draggingNode:ue,draggingNodeRect:Ye,droppableContainers:C,over:Be,scrollableAncestors:ft,scrollAdjustedTranslate:le},z.current={initial:Ye,translated:Ae}},[M,Y,W,Ae,k,ue,Ye,L,C,Be,ft,le]),lY({...te,delta:F,draggingRect:Ae,pointerCoordinates:qe,scrollableAncestors:ft,scrollableAncestorRects:dt});const Ie=g.useMemo(()=>({active:M,activeNode:Y,activeNodeRect:he,activatorEvent:q,collisions:W,containerNodeRect:be,dragOverlay:Pe,draggableNodes:k,droppableContainers:C,droppableRects:L,over:Be,measureDroppableContainers:Ee,scrollableAncestors:ft,scrollableAncestorRects:dt,measuringConfiguration:ie,measuringScheduled:fe,windowRect:At}),[M,Y,he,q,W,be,Pe,k,C,L,Be,Ee,ft,dt,ie,fe,At]),gt=g.useMemo(()=>({activatorEvent:q,activators:je,active:M,activeNodeRect:he,ariaDescribedById:{draggable:I},dispatch:E,draggableNodes:k,over:Be,measureDroppableContainers:Ee}),[q,je,M,he,E,I,k,Be,Ee]);return Ve.createElement(Jv.Provider,{value:S},Ve.createElement(uo.Provider,{value:gt},Ve.createElement(fA.Provider,{value:Ie},Ve.createElement(qu.Provider,{value:kt},c)),Ve.createElement(CY,{disabled:l?.restoreFocus===!1})),Ve.createElement(LV,{...l,hiddenTextDescribedById:I}));function Ft(){const ve=H?.autoScrollEnabled===!1,He=typeof u=="object"?u.enabled===!1:u===!1,$e=T&&!ve&&!He;return typeof u=="object"?{...u,enabled:$e}:{enabled:$e}}}),OY=g.createContext(null),x1="button",LY="Draggable";function jY(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Gu(LY),{activators:o,activatorEvent:l,active:u,activeNodeRect:c,ariaDescribedById:d,draggableNodes:p,over:f}=g.useContext(uo),{role:m=x1,roleDescription:b="draggable",tabIndex:x=0}=s??{},y=u?.id===t,E=g.useContext(y?qu:OY),[v,S]=Ml(),[A,N]=Ml(),T=SY(o,t),w=ji(n);Tr(()=>(p.set(t,{id:t,key:i,node:v,activatorNode:A,data:w}),()=>{const F=p.get(t);F&&F.key===i&&p.delete(t)}),[p,t]);const k=g.useMemo(()=>({role:m,tabIndex:x,"aria-disabled":r,"aria-pressed":y&&m===x1?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[r,m,x,y,b,d.draggable]);return{active:u,activatorEvent:l,activeNodeRect:c,attributes:k,isDragging:y,listeners:r?void 0:T,node:v,over:f,setNodeRef:S,setActivatorNodeRef:N,transform:E}}function MY(){return g.useContext(fA)}const FY="Droppable",PY={timeout:25};function BY(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Gu(FY),{active:o,dispatch:l,over:u,measureDroppableContainers:c}=g.useContext(uo),d=g.useRef({disabled:n}),p=g.useRef(!1),f=g.useRef(null),m=g.useRef(null),{disabled:b,updateMeasurementsFor:x,timeout:y}={...PY,...s},E=ji(x??r),v=g.useCallback(()=>{if(!p.current){p.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(E.current)?E.current:[E.current]),m.current=null},y)},[y]),S=Wu({callback:v,disabled:b||!o}),A=g.useCallback((k,F)=>{S&&(F&&(S.unobserve(F),p.current=!1),k&&S.observe(k))},[S]),[N,T]=Ml(A),w=ji(t);return g.useEffect(()=>{!S||!N.current||(S.disconnect(),p.current=!1,S.observe(N.current))},[N,S]),g.useEffect(()=>(l({type:Yt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:N,rect:f,data:w}}),()=>l({type:Yt.UnregisterDroppable,key:i,id:r})),[r]),g.useEffect(()=>{n!==d.current.disabled&&(l({type:Yt.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,l]),{active:o,rect:f,isOver:u?.id===r,node:N,over:u,setNodeRef:T}}function UY(e){let{animation:t,children:n}=e;const[r,s]=g.useState(null),[i,o]=g.useState(null),l=Fl(n);return!n&&!r&&l&&s(l),Tr(()=>{if(!i)return;const u=r?.key,c=r?.props.id;if(u==null||c==null){s(null);return}Promise.resolve(t(c,i)).then(()=>{s(null)})},[t,r,i]),Ve.createElement(Ve.Fragment,null,n,r?g.cloneElement(r,{ref:o}):null)}const $Y={x:0,y:0,scaleX:1,scaleY:1};function zY(e){let{children:t}=e;return Ve.createElement(uo.Provider,{value:pA},Ve.createElement(qu.Provider,{value:$Y},t))}const HY={position:"fixed",touchAction:"none"},GY=e=>dx(e)?"transform 250ms ease":void 0,WY=g.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:l,style:u,transform:c,transition:d=GY}=e;if(!l)return null;const p=s?c:{...c,scaleX:1,scaleY:1},f={...HY,width:l.width,height:l.height,top:l.top,left:l.left,transform:ua.Transform.toString(p),transformOrigin:s&&r?MV(r,l):void 0,transition:typeof d=="function"?d(r):d,...u};return Ve.createElement(n,{className:o,style:f,ref:t},i)}),qY=e=>t=>{let{active:n,dragOverlay:r}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[l,u]of Object.entries(i.active))u!==void 0&&(s[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,u));if(i!=null&&i.dragOverlay)for(const[l,u]of Object.entries(i.dragOverlay))u!==void 0&&r.node.style.setProperty(l,u);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[u,c]of Object.entries(s))n.node.style.setProperty(u,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},VY=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ua.Transform.toString(t)},{transform:ua.Transform.toString(n)}]},YY={duration:250,easing:"ease",keyframes:VY,sideEffects:qY({styles:{active:{opacity:"0"}}})};function KY(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=e;return Hu((i,o)=>{if(t===null)return;const l=n.get(i);if(!l)return;const u=l.node.current;if(!u)return;const c=dA(o);if(!c)return;const{transform:d}=Tn(o).getComputedStyle(o),p=tA(d);if(!p)return;const f=typeof t=="function"?t:ZY(t);return lA(u,s.draggable.measure),f({active:{id:i,data:l.data,node:u,rect:s.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:p})})}function ZY(e){const{duration:t,easing:n,sideEffects:r,keyframes:s}={...YY,...e};return i=>{let{active:o,dragOverlay:l,transform:u,...c}=i;if(!t)return;const d={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},p={scaleX:u.scaleX!==1?o.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?o.rect.height*u.scaleY/l.rect.height:1},f={x:u.x-d.x,y:u.y-d.y,...p},m=s({...c,active:o,dragOverlay:l,transform:{initial:u,final:f}}),[b]=m,x=m[m.length-1];if(JSON.stringify(b)===JSON.stringify(x))return;const y=r?.({active:o,dragOverlay:l,...c}),E=l.node.animate(m,{duration:t,easing:n,fill:"forwards"});return new Promise(v=>{E.onfinish=()=>{y?.(),v()}})}}let y1=0;function XY(e){return g.useMemo(()=>{if(e!=null)return y1++,y1},[e])}const QY=Ve.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:l="div",className:u,zIndex:c=999}=e;const{activatorEvent:d,active:p,activeNodeRect:f,containerNodeRect:m,draggableNodes:b,droppableContainers:x,dragOverlay:y,over:E,measuringConfiguration:v,scrollableAncestors:S,scrollableAncestorRects:A,windowRect:N}=MY(),T=g.useContext(qu),w=XY(p?.id),k=mA(o,{activatorEvent:d,active:p,activeNodeRect:f,containerNodeRect:m,draggingNodeRect:y.rect,over:E,overlayNodeRect:y.rect,scrollableAncestors:S,scrollableAncestorRects:A,transform:T,windowRect:N}),F=bx(f),C=KY({config:r,draggableNodes:b,droppableContainers:x,measuringConfiguration:v}),$=F?y.setRef:void 0;return Ve.createElement(zY,null,Ve.createElement(UY,{animation:C},p&&w?Ve.createElement(WY,{key:w,id:p.id,ref:$,as:l,activatorEvent:d,adjustScale:t,className:u,transition:i,rect:F,style:{zIndex:c,...s},transform:k},n):null))}),JY=6e4,eK=10080*60*1e3,tK={P1:"error",P2:"warning",P3:"neutral"},nK={backlog:"bg-spur-text-faint",todo:"bg-spur-info",wip:"bg-spur-warning",testing:"bg-spur-accent",done:"bg-spur-success",blocked:"bg-spur-error",cancelled:"bg-spur-text-faint"};function rK(e,t){const n=new Date(e).getTime(),r=t-n,s=Math.floor(r/1e3);if(s<60)return"just now";const i=Math.floor(s/60);if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const l=Math.floor(o/24);return l<30?`${l}d ago`:`${Math.floor(l/30)}mo ago`}function hA({task:e,onClick:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,isDragging:o}=jY({id:e.wbs,data:{task:e}}),[l,u]=g.useState(Date.now());g.useEffect(()=>{const m=setInterval(()=>u(Date.now()),JY);return()=>clearInterval(m)},[]);const c=i?{transform:ua.Transform.toString(i),zIndex:o?50:void 0}:void 0,{subtaskProgress:d}=ex(),p=d.get(e.wbs),f=e.updatedAt?l-new Date(e.updatedAt).getTime()>eK:!1;return a.jsx(v7,{variant:"compact",asChild:!0,className:`group bg-spur-surface-2 hover:bg-spur-surface-3 rounded-xl border border-spur-border hover:border-spur-accent/60 shadow-xs hover:shadow-md cursor-pointer transition-all duration-150 w-full text-left ${o?"opacity-30":""}`,children:a.jsx("button",{ref:s,type:"button",style:c,onClick:()=>t(e.wbs),...r,...n,"aria-roledescription":"draggable card",children:a.jsxs(A7,{className:"p-3 gap-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-mono font-semibold text-spur-text",children:[a.jsx("span",{className:`h-2 w-2 rounded-full shrink-0 ring-1 ring-spur-surface-2 ${nK[e.status]??"bg-spur-text-faint"}`,"data-status":e.status,"aria-hidden":"true"}),e.wbs]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[e.estimateHours!==void 0&&a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted flex items-center gap-0.5",title:`Estimated: ${e.estimateHours}h`,children:[a.jsx("span",{className:"text-spur-text-faint text-[9px]",children:"⏱"}),e.estimateHours,"h"]}),e.priority&&a.jsx(Lt,{variant:tK[e.priority]??"outline",size:"xs",className:"font-mono text-[10px] font-semibold",children:e.priority})]})]}),a.jsx("p",{className:"text-sm font-medium text-spur-text leading-snug line-clamp-2 group-hover:text-spur-accent transition-colors",children:e.name}),a.jsxs("div",{className:"flex gap-1.5 flex-wrap items-center pt-0.5",children:[p&&p.total>0&&a.jsxs("div",{className:"flex items-center gap-1.5 min-w-[3.5rem]","data-testid":"subtask-progress",title:"subtasks done/total",children:[a.jsx("div",{className:"h-1 flex-1 rounded-full bg-spur-border/60 overflow-hidden",children:a.jsx("div",{className:"h-full bg-spur-success",style:{width:`${Math.round(p.done/p.total*100)}%`}})}),a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted shrink-0",children:[p.done,"/",p.total]})]}),e.type&&e.type!=="task"&&a.jsx(Lt,{variant:"outline",size:"xs",className:"text-[10px] font-mono border-spur-border text-spur-text-muted",children:e.type}),e.template&&e.template!=="feature-impl"&&a.jsx(Lt,{variant:"outline",size:"xs",className:"text-[10px] font-mono border-spur-accent/40 text-spur-accent bg-spur-accent/5 font-medium",children:e.template}),e.featureId&&a.jsx(Lt,{variant:"outline",size:"xs",className:"text-[10px] font-mono border-spur-border text-spur-text-muted",children:e.featureId}),e.dependencyCount!==void 0&&e.dependencyCount>0&&a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted flex items-center gap-0.5",title:`${e.dependencyCount} dependenc${e.dependencyCount===1?"y":"ies"}`,children:[a.jsx("span",{className:"text-spur-text-faint text-[9px]",children:"⛓"}),e.dependencyCount]}),e.updatedAt&&a.jsx("span",{className:`text-xs font-mono ml-auto ${f?"text-spur-text-faint":"text-spur-text-muted"}`,title:e.updatedAt,children:rK(e.updatedAt,l)})]})]})})})}function sK({status:e,label:t,tasks:n,onCardClick:r,sortDir:s,onSortToggle:i}){const{setNodeRef:o,isOver:l}=BY({id:e,data:{status:e}});return a.jsxs("section",{ref:o,"aria-label":`${t} column`,className:`flex flex-col flex-1 min-w-[16rem] rounded-xl border transition-colors duration-200 overflow-hidden ${l?"bg-spur-surface/40 border-spur-accent shadow-lg ring-1 ring-spur-accent/30":"bg-transparent border-spur-border"}`,children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-spur-border shrink-0 bg-spur-surface",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:[yp(e)," ",t]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Lt,{variant:"ghost",size:"sm",className:"font-mono text-spur-text-muted bg-spur-surface-2 border border-spur-border/80 px-2 py-0.5",children:n.length}),i&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"h-6 w-6 p-0 flex items-center justify-center text-spur-text-muted hover:text-spur-text hover:bg-spur-surface-2 rounded-md transition-colors",onClick:i,"aria-label":`Sort ${t} by WBS`,title:`Sort ${t}: ${s==="asc"?"WBS ↓":s==="desc"?"WBS ↑":"none"}`,children:s==="asc"?"↓":s==="desc"?"↑":"⇅"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[4rem]",children:[n.map(u=>a.jsx(hA,{task:u,onClick:r},u.wbs)),n.length===0&&a.jsx("div",{className:"flex items-center justify-center h-20 text-xs text-spur-text-muted italic border border-dashed border-spur-border/60 rounded-lg my-1 bg-spur-surface/30",children:"No tasks"})]})]})}const aK=g.lazy(()=>Zw(()=>import("./TaskDetail.IKc3uDYV.js"),__vite__mapDeps([2,3,1,4,5]))),iK=Fn,gA="docs/tasks",E1="spur:detail-width",oK=new Set(["blocked","cancelled"]);function lK(e,t){return t?e.filter(n=>!(t.status!==void 0&&!t.status.split(",").includes(n.status)||t.featureId&&!n.featureId?.toLowerCase().includes(t.featureId.toLowerCase())||t.parentWbs&&n.parentWbs!==t.parentWbs)):e}function bA(e){const{onSelectTask:t,filters:n,folder:r,hiddenColumns:s,onConnectionChange:i,onSyncChange:o}=e,[l,u]=g.useState({}),[c,d]=g.useState(gA),[p,f]=g.useState(null),[m,b]=g.useState(()=>{const Z=typeof window<"u"?Math.min(1728,window.innerWidth*.8):1728;if(typeof window>"u")return Z;try{const ie=Number.parseFloat(window.localStorage.getItem(E1)??"");if(Number.isFinite(ie)&&ie>0)return Math.min(ie,window.innerWidth*.8)}catch{}return Z}),x=r??c,y=s??oK,E=g.useCallback(()=>Pt.task.list({folder:x}),[x]),{tasks:v,loading:S,error:A,connected:N,lastSyncAt:T,setTasks:w,store:k}=ex(E),[F,C]=g.useState(null);g.useEffect(()=>{i?.(N)},[N,i]),g.useEffect(()=>{o?.(T)},[T,o]),g.useEffect(()=>{typeof Pt.task.folders=="function"&&Pt.task.folders({}).then(Z=>{const{data:ie,activeFolder:L}=Z,Ee=L??ie?.[0]?.path;Ee!==void 0&&d(Ee)}).catch(()=>{})},[]),g.useEffect(()=>{document.documentElement.style.setProperty("--detail-w",`${m}px`)},[m]),g.useEffect(()=>{if(!p)return;const Z=ie=>{ie.key==="Escape"&&f(null)};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[p]);const $=Pi();g.useEffect(()=>{const Z=$.pathname.split("/"),ie=Z.indexOf("tasks"),L=ie>=0?Z[ie+1]:void 0;L&&/^\d{4}$/.test(L)&&f(L)},[$.pathname]);const z=l1(gx,{activationConstraint:{distance:5}}),M=l1(mx),G=jV(z,M),H=lK(v,n),j=Z=>{u(ie=>{const L={...ie};return ie[Z]==="asc"?L[Z]="desc":ie[Z]==="desc"?delete L[Z]:L[Z]="asc",L})},q=Z=>{const ie=H.filter(Ee=>Ee.status===Z),L=l[Z]??"desc";return[...ie].sort((Ee,fe)=>{const Y=Ee.wbs.localeCompare(fe.wbs);return L==="asc"?Y:-Y})},re=Z=>v.find(ie=>ie.wbs===Z),pe=Z=>{C(String(Z.active.id))},I=Z=>{C(null);const{active:ie,over:L}=Z;if(!L)return;const Ee=String(ie.id),fe=String(L.id),Y=re(Ee);if(!Y||Y.status===fe)return;const me=[...v];w(te=>te.map(O=>O.wbs===Ee?{...O,status:fe}:O)),Pt.task.transition({wbs:Ee,toStatus:fe}).catch(te=>{w(me);const O=te instanceof Error?te.message:"Transition failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:O}}))})};return S?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx(Ss,{size:"lg",className:"text-spur-accent"})}):A?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center text-spur-text-muted",children:[a.jsx("p",{className:"text-lg font-semibold",children:"Failed to load tasks"}),a.jsx("p",{className:"text-sm",children:A.message})]})}):a.jsx(sv.Provider,{value:k,children:a.jsxs(DY,{sensors:G,onDragStart:pe,onDragEnd:I,children:[a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"flex gap-3 overflow-x-auto h-full p-4",children:iK.filter(Z=>!y.has(Z)).map(Z=>a.jsx(sK,{status:Z,label:Z,tasks:q(Z),onCardClick:ie=>{f(ie),t(ie)},sortDir:l[Z],onSortToggle:()=>j(Z)},Z))}),p&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button","aria-label":"Close task detail",className:"fixed inset-0 z-50 bg-black/40 border-0 p-0 cursor-default",onClick:()=>f(null)}),a.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Task detail",className:"fixed top-0 right-0 h-full z-50 bg-spur-surface border-l border-spur-border shadow-2xl flex",style:{width:"var(--detail-w)",minWidth:"36rem",maxWidth:"80vw"},children:[a.jsx(Li,{targetVar:"--detail-w",onResizeEnd:Z=>{const ie=Math.max(576,Math.min(Z,window.innerWidth*.8));b(ie);try{window.localStorage.setItem(E1,String(ie))}catch{}},direction:"horizontal",invert:!0}),a.jsx("div",{className:"flex flex-col flex-1 overflow-hidden",children:a.jsx("div",{className:"flex-1 overflow-y-auto","data-testid":"detail-body",children:(()=>{const Z=v.find(ie=>ie.wbs===p);return Z?a.jsx(g.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-32 text-spur-text-muted text-sm",children:"Loading detail..."}),children:a.jsx(aK,{task:Z,onClose:()=>f(null),onTransition:(ie,L)=>{w(Ee=>Ee.map(fe=>fe.wbs===ie?{...fe,status:L}:fe)),Pt.task.transition({wbs:ie,toStatus:L}).catch(Ee=>{const fe=Ee instanceof Error?Ee.message:"Transition failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:fe}}))})}})}):null})()})})]})]})]}),a.jsx(QY,{dropAnimation:null,children:F?(()=>{const Z=re(F);return Z?a.jsx("div",{className:"opacity-90",children:a.jsx(hA,{task:Z,onClick:()=>{}})}):null})():null})]})})}const id=[{id:"kanban",label:"Kanban",component:bA}];function xA(){const[e,t]=ap(),n=Pi(),r=ip(),s=g.useMemo(()=>{const u=n.pathname.split("/"),c=u.indexOf("tasks"),d=c>=0?u[c+1]:void 0;return d&&/^\d{4}$/.test(d)?d:e.get("selected")},[n.pathname,e]),i=g.useMemo(()=>{const u={},c=e.get("status"),d=e.get("feature"),p=e.get("parent"),f=e.get("assignee"),m=e.get("folder");return c!==null&&(u.status=c),d&&(u.featureId=d),p&&(u.parentWbs=p),f&&(u.assignee=f),m&&(u.folder=m),u},[e]);return{selected:s,filters:i,selectTask:u=>{const c=new URLSearchParams(e);c.delete("selected");const d=c.toString(),p=u?`/board/tasks/${u}`:"/board/tasks";r(`${p}${d?`?${d}`:""}`,{replace:!0})},setFilter:(u,c)=>{t(d=>{const p=new URLSearchParams(d);return u==="feature"&&p.delete("parent"),u==="parent"&&p.delete("feature"),c!==null?p.set(u,c):p.delete(u),p},{replace:!0})}}}function uK(e){const t=e.trim();return/^\d{4}$/.test(t)?{kind:"navigate",wbs:t}:t.includes(".")?{kind:"filter",key:"parent",value:t}:{kind:"filter",key:"feature",value:t}}function cK(){const{selectTask:e,setFilter:t,filters:n}=xA(),[r,s]=g.useState(gA),[i,o]=g.useState([]),[l,u]=g.useState("kanban"),[c,d]=g.useState(!1),[p,f]=g.useState(""),[m,b]=g.useState(!1),[x,y]=g.useState(void 0),E=n.folder??r,v=new Set(n.status===void 0?Fn.filter(w=>w!=="blocked"&&w!=="cancelled"):n.status.split(",").filter(w=>Fn.some(k=>k===w))),S=new Set(Fn.filter(w=>!v.has(w)));g.useEffect(()=>{f(n.featureId??n.parentWbs??"")},[n.featureId,n.parentWbs]),g.useEffect(()=>{typeof Pt.task.folders=="function"&&Pt.task.folders({}).then(w=>{const{data:k,activeFolder:F}=w,C=F??k?.[0]?.path;k&&o(k),C!==void 0&&s(C)}).catch(()=>{})},[]);const A=w=>{const k=new Set(v);k.has(w)?k.delete(w):k.add(w),t("status",Fn.filter(F=>k.has(F)).join(","))},N=w=>{w.preventDefault();const k=uK(p);if(k.kind==="navigate"){e(k.wbs),f("");return}t(k.key,k.value||null)},T=(id.find(w=>w.id===l)??id[0]).component;return a.jsxs("div",{className:"task-kanban flex flex-col h-full",children:[a.jsx("header",{className:"mx-auto w-full max-w-[1600px] shrink-0 px-4 pt-3",children:a.jsxs("div",{className:"flex flex-nowrap items-center justify-between gap-4 border-b border-spur-border pb-3",children:[a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:"📋"}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight text-spur-text",children:"Tasks"}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-spur-border bg-spur-surface-2 px-2.5 py-0.5 text-xs text-spur-text-muted font-mono",role:"status","data-testid":"tasks-live-chip",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${m?"bg-spur-success":"bg-spur-error"}`,"aria-hidden":"true"}),"last sync ",x?new Date(x).toLocaleString():"—"]})]}),a.jsx("p",{className:"text-xs text-spur-text-muted mt-0.5",children:"Task corpus, kanban lanes, and phase filters"})]})]}),a.jsxs("div",{className:"flex min-w-0 flex-nowrap items-center gap-2.5 overflow-x-auto",children:[a.jsx(ci,{variant:"ghost",size:"xs",className:"text-xs shrink-0 w-44 bg-spur-surface-2 border border-spur-border rounded-lg text-spur-text",value:E,onChange:w=>t("folder",w.target.value),"aria-label":"Task phase folder",children:i.map(w=>a.jsx("option",{value:w.path,children:w.label?`${w.label} (${w.path})`:w.path},w.path))}),a.jsx("div",{className:"flex shrink-0 items-center gap-1 bg-spur-surface-2 border border-spur-border px-2 py-1 rounded-xl",children:Fn.map(w=>a.jsxs("label",{htmlFor:`tasks-status-${w}`,className:"flex items-center gap-1.5 px-1.5 py-0.5 rounded-md hover:bg-spur-surface-3 transition-colors cursor-pointer",children:[a.jsx(Mb,{id:`tasks-status-${w}`,size:"xs",checked:!S.has(w),onChange:()=>A(w)}),a.jsxs("span",{className:"text-[11px] font-medium text-spur-text-muted select-none",children:[yp(w)," ",w]})]},w))}),a.jsx("form",{onSubmit:N,className:"flex shrink-0 items-center",children:a.jsx(Ii,{"aria-label":"Filter by WBS or feature",type:"text",placeholder:"WBS or feature",variant:"bordered",size:"xs",className:"w-36 bg-spur-surface-2 border-spur-border text-spur-text",value:p,onChange:w=>f(w.target.value)})}),a.jsx(Fe,{variant:"primary",size:"sm",className:"shrink-0 font-medium",onClick:()=>d(!0),children:"+ New Task"}),a.jsx("div",{className:"flex shrink-0 items-center gap-1 bg-spur-surface-2 border border-spur-border p-1 rounded-xl",children:id.map(w=>a.jsx("button",{type:"button",className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${l===w.id?"bg-primary text-primary-content font-bold shadow-sm":"text-spur-text-muted hover:text-spur-text hover:bg-spur-surface-3"}`,onClick:()=>u(w.id),children:w.label},w.id))})]})]})}),a.jsx("div",{"data-kanban-board":!0,className:"flex-1 overflow-hidden",children:a.jsx(T,{onSelectTask:e,filters:n,folder:E,hiddenColumns:S,onConnectionChange:b,onSyncChange:y})}),a.jsx(nv,{open:c,onClose:()=>d(!1),onCreated:()=>{},folder:E})]})}function dK(e,t){Pt.task.transition({wbs:e,toStatus:t}).catch(n=>{const r=n instanceof Error?n.message:"Transition failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:r}}))})}function pK(){const{filters:e,selectTask:t}=xA();return a.jsx("div",{className:"task-kanban flex flex-col h-full",children:a.jsx("div",{"data-kanban-board":!0,className:"flex-1 overflow-hidden",children:a.jsx(bA,{onSelectTask:t,filters:e})})})}const fK={id:"tasks",name:"Tasks",icon:"📋",route:"tasks",component:cK,sidebarLabel:"Tasks",description:"Task kanban, lifecycle status, and per-task detail",order:40},mK=Object.freeze(Object.defineProperty({__proto__:null,TaskKanbanView:pK,module:fK,transition:dK},Symbol.toStringTag,{value:"Module"}));function yA(e){return e===null||typeof e!="object"?null:"module"in e&&S1(e.module)?e.module:"default"in e&&S1(e.default)?e.default:null}function S1(e){return e===null||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"icon"in e&&typeof e.icon=="string"&&"route"in e&&typeof e.route=="string"&&"component"in e&&typeof e.component=="function"}function EA(e,t){const n=typeof e.order=="number",r=typeof t.order=="number";return n&&r?e.order-t.order:n?-1:r?1:0}function hK(e){const t=[],n=e("./*/index.{ts,tsx}",{eager:!0});for(const r of Object.values(n)){const s=yA(r);s&&t.push(s)}return t.sort((r,s)=>r.id.localeCompare(s.id)),t.sort(EA),t}function gK(){try{return hK(()=>Object.assign({"./designs/index.tsx":YH,"./features/index.tsx":wG,"./history/index.tsx":sW,"./observability/index.tsx":JW,"./plans/index.tsx":uq,"./projects/index.tsx":Bq,"./settings/index.tsx":SV,"./task-kanban/index.tsx":mK}))}catch(s){if(typeof require!="function")throw s}const e=require("node:fs"),t=require("node:path"),n=require("node:url"),r=typeof __dirname<"u"?__dirname:t.dirname(n.fileURLToPath(import.meta.url));return bK(r,{readdirSync:(s,i)=>e.readdirSync(s,i),tryRequire:s=>require(s)})}function bK(e,t){const n=require("node:path"),r=[];let s=[];try{s=t.readdirSync(e,{withFileTypes:!0})}catch{return r}const i=s.filter(o=>o.isDirectory()).map(o=>o.name).sort((o,l)=>o.localeCompare(l));for(const o of i)for(const l of["tsx","ts"]){const u=n.join(e,o,`index.${l}`);try{const c=t.tryRequire(u),d=yA(c);if(d){r.push(d);break}}catch{}}return r.sort(EA),r}function SA(e,t){const n=new Set(t?.disabled??[]),r=e.slice(),s=new Set(n);function i(){return r.filter(o=>!s.has(o.id))}return xK(r),{get modules(){return i()},getModule(o){return i().find(l=>l.id===o)},get defaultModule(){return i()[0]},disableModule(o){s.add(o)},enableModule(o){s.delete(o)},getEnabledModules(){return i().map(o=>o.id)},registerModuleRoot(o){}}}function xK(e){const t=new Map,n=new Map;for(const r of e){const s=t.get(r.id);if(s!==void 0)throw new Error(`Duplicate module id "${r.id}" discovered in two sources: ${s} and ${Ko(r)}`);t.set(r.id,Ko(r));const i=n.get(r.route);if(i!==void 0)throw new Error(`Duplicate module route "${r.route}" discovered in two sources: ${i} and ${Ko(r)}`);n.set(r.route,Ko(r))}}function Ko(e){return e.id}const xx=SA(gK(),{disabled:pL}),Fi=xx;xx.modules;xx.defaultModule;const TA=g.createContext({registry:Fi,hostDiagnostics:[]});function yK({value:e,children:t}){return a.jsx(TA.Provider,{value:e,children:t})}function NA(){return g.useContext(TA)}const sp="spur-board-layout-v3",T1="spur-board-layout-v2",N1="spur-board-layout",nr={version:3,sidebarWidth:240,rightPanelWidth:320,sidebarCollapsed:!0,rightPanelCollapsed:!0};function EK(){try{const e=localStorage.getItem(sp);if(e){const s=JSON.parse(e);return{version:3,sidebarWidth:typeof s.sidebarWidth=="number"?s.sidebarWidth:nr.sidebarWidth,rightPanelWidth:typeof s.rightPanelWidth=="number"?s.rightPanelWidth:nr.rightPanelWidth,sidebarCollapsed:typeof s.sidebarCollapsed=="boolean"?s.sidebarCollapsed:nr.sidebarCollapsed,rightPanelCollapsed:typeof s.rightPanelCollapsed=="boolean"?s.rightPanelCollapsed:nr.rightPanelCollapsed}}const t=localStorage.getItem(T1),n=localStorage.getItem(N1),r=t||n;if(r){const s=JSON.parse(r),i={version:3,sidebarWidth:typeof s.sidebarWidth=="number"?s.sidebarWidth:nr.sidebarWidth,rightPanelWidth:typeof s.rightPanelWidth=="number"?s.rightPanelWidth:nr.rightPanelWidth,sidebarCollapsed:nr.sidebarCollapsed,rightPanelCollapsed:typeof s.rightPanelCollapsed=="boolean"?s.rightPanelCollapsed:nr.rightPanelCollapsed};try{localStorage.setItem(sp,JSON.stringify(i)),localStorage.removeItem(T1),localStorage.removeItem(N1)}catch{}return i}return{...nr}}catch{return{...nr}}}function SK(e){try{localStorage.setItem(sp,JSON.stringify({...e,version:3}))}catch{}}const wA="spur.board.projects.draft.v1";function qs(e){return{path:e,text:"",refs:[],revision:0}}function TK(e){if(e===null||typeof e!="object")return!1;const t=e;return t.kind==="task"?typeof t.wbs=="string"&&t.wbs.length>0:t.kind==="feature"?typeof t.id=="string"&&t.id.length>0:!1}function NK(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;const t=e;return typeof t.path!="string"||typeof t.text!="string"||typeof t.revision!="number"||!Number.isFinite(t.revision)||!Array.isArray(t.refs)||!t.refs.every(n=>TK(n))?null:{...t,path:t.path,text:t.text,refs:t.refs,revision:t.revision}}function wK(e){try{const t=globalThis.localStorage?.getItem(wA);if(t==null)return qs(e);const n=NK(JSON.parse(t));return n===null||n.path!==e?(js(qs(e)),qs(e)):n}catch{return qs(e)}}function js(e){try{globalThis.localStorage?.setItem(wA,JSON.stringify(e))}catch{}}const vK={draft:qs(""),setText:()=>{},addRef:()=>{},removeRef:()=>{},persistPending:()=>{},clearSubmitted:()=>{}},vA=g.createContext(vK);function AK(){return g.useContext(vA)}function kK({children:e}){const n=_a().path,[r,s]=g.useState(()=>qs(""));g.useEffect(()=>{n!==null&&s(wK(n))},[n]);const i=g.useMemo(()=>({draft:r,setText:o=>s(l=>{if(l.path==="")return l;const u={...l,text:o,revision:l.revision+1};return js(u),u}),addRef:o=>s(l=>{if(l.path===""||l.refs.some(c=>Xc(c,o)))return l;const u={...l,refs:[...l.refs,o],revision:l.revision+1};return js(u),u}),removeRef:o=>s(l=>{if(l.path===""||!l.refs.some(c=>Xc(c,o)))return l;const u={...l,refs:l.refs.filter(c=>!Xc(c,o)),revision:l.revision+1};return js(u),u}),persistPending:o=>s(l=>{if(l.path==="")return l;const u={...l,pending:{requestKey:o,revision:l.revision}};return js(u),u}),clearSubmitted:o=>s(l=>{if(l.path===""||l.revision!==o)return l;const u={path:l.path,text:"",refs:[],revision:l.revision+1};return js(u),u})}),[r]);return a.jsx(vA.Provider,{value:i,children:e})}function _K(){const[e,t]=g.useState([]);return g.useEffect(()=>{if(typeof window>"u")return;const n=r=>{const i=r.detail?.message||"An error occurred",o=`${Date.now()}-${Math.random().toString(36).slice(2,7)}`;t(l=>[...l,{id:o,message:i}]),setTimeout(()=>{t(l=>l.filter(u=>u.id!==o))},5e3)};return window.addEventListener("api-error",n),()=>{window.removeEventListener("api-error",n)}},[]),e.length===0?null:a.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-md w-full px-4 pointer-events-none",children:e.map(n=>a.jsxs("div",{className:"pointer-events-auto flex items-center justify-between gap-3 p-3 bg-red-950/90 border border-red-500/40 text-red-200 text-sm rounded-md shadow-lg backdrop-blur",role:"alert",children:[a.jsx("span",{className:"flex-1 break-words",children:n.message}),a.jsx("button",{type:"button",className:"text-red-400 hover:text-red-100 text-base font-bold leading-none px-1",onClick:()=>t(r=>r.filter(s=>s.id!==n.id)),"aria-label":"Close error toast",children:"×"})]},n.id))})}const CK="Enter",IK=229;function RK(e){return e.key===CK&&!e.shiftKey&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==IK}const DK=[{name:"/review",description:"Inspect staged git diff, verify test coverage & lint",category:"git",argumentHint:"[target] [--cached]",tags:["builtin","git","review"]},{name:"/commit",description:"Draft conventional commit message from staged hunks",category:"git",argumentHint:"[--all] [-m <message>]",tags:["builtin","git","commit"]},{name:"/compact",description:"Purge execution trace and condense context window",category:"sys",argumentHint:"[focus]",tags:["builtin","sys","compact"]},{name:"/revert",description:"Undo last agent file changes or restore git stash",category:"git",argumentHint:"[stash-id | file]",tags:["builtin","git","revert"]},{name:"/resume",description:"Resume paused background agent run",category:"dev",argumentHint:"[run-id]",tags:["builtin","dev","resume"]},{name:"/terminal",description:"Run isolated bash execution in sandbox mirror",category:"sys",argumentHint:"[command]",tags:["builtin","sys","terminal"]},{name:"/cost",description:"Inspect token breakdown and USD expenditure",category:"sys",tags:["builtin","sys","cost"]},{name:"/sp:dev-plan",description:"Plan a feature from description (intake → AC → tasks)",category:"harness",argumentHint:'"<description>" [--feature <id>]',tags:["sp","dev","plan"]},{name:"/sp:dev-run",description:"Drive one task end-to-end through verification pipeline",category:"harness",argumentHint:"<wbs> [--mode <full|implement>]",tags:["sp","dev","run"]},{name:"/sp:dev-verify",description:"Verify a task against requirements and acceptance criteria",category:"harness",argumentHint:"<wbs> [--bdd] [--auto]",tags:["sp","dev","verify"]}],OK=[{id:"auto",label:"auto",desc:"Orchestrator auto-dispatch (default)"},{id:"coder",label:"coder",desc:"Implementation & refactoring specialist"},{id:"reviewer",label:"reviewer",desc:"Verification, lint & SECUA reviewer"},{id:"planner",label:"planner",desc:"Architecture & decomposition specialist"}];function LK(e){if(!e)return!0;const{state:t,instanceId:n}=e.orchestrator;return t==="missing"||t==="unresolvable"||!n}function jK({activeModule:e}){const[t,n]=g.useState(!1),[r,s]=g.useState(!1),[i,o]=g.useState(null),[l,u]=g.useState("auto"),[c,d]=g.useState(!1),[p,f]=g.useState(!1),[m,b]=g.useState(0),[x,y]=g.useState("all"),[E,v]=g.useState(DK),S=g.useMemo(()=>{const O=new Map;for(const ye of E){if(Array.isArray(ye.tags)){for(const we of ye.tags)if(we&&typeof we=="string"){const Pe=we.trim().toLowerCase();O.set(Pe,(O.get(Pe)??0)+1)}}if(ye.category){const we=ye.category.trim().toLowerCase();O.set(we,(O.get(we)??0)+1)}}const he=["sp","cc","kk","wt","git","dev","sys","harness","builtin"];return["all",...Array.from(O.keys()).sort((ye,we)=>{const Pe=he.indexOf(ye),ue=he.indexOf(we);if(Pe!==-1&&ue!==-1)return Pe-ue;if(Pe!==-1)return-1;if(ue!==-1)return 1;const Ye=(O.get(we)??0)-(O.get(ye)??0);return Ye!==0?Ye:ye.localeCompare(we)})]},[E]),A=_a(),{draft:N,setText:T,persistPending:w,clearSubmitted:k}=AK(),F=A.fleet?.orchestrator?.instanceId,C=LK(A.fleet),{requests:$,failed:z}=Bv(F??null),M=i!==null?$.get(i)??null:null,G=Mv(M,A.fleet,r),H=jv[G],j=r||i!==null,q=j?`${H.label} — Next: ${H.action}`:"",re=g.useRef(null);g.useEffect(()=>{let O=!0;return(async()=>{try{const he=await Ge(new Request(`${nt()}/agent/commands`));if(he.ok){const be=await he.json();O&&Array.isArray(be.commands)&&be.commands.length>0&&v(be.commands)}}catch{}})(),()=>{O=!1}},[]),g.useEffect(()=>{if(!c)return;const O=he=>{re.current&&!re.current.contains(he.target)&&d(!1)};return document.addEventListener("click",O),()=>document.removeEventListener("click",O)},[c]),g.useEffect(()=>{N.text.startsWith("/")&&f(!1)},[N.text]);const pe=N.text.trim().toLowerCase(),I=pe.startsWith("/")&&!p,Z=I?E.filter(O=>{const he=x==="all"||Array.isArray(O.tags)&&O.tags.map(we=>we.toLowerCase()).includes(x)||O.category.toLowerCase()===x,be=pe.startsWith("/")?pe.slice(1):pe,ye=O.name.toLowerCase().startsWith(pe)||O.name.toLowerCase().includes(be)||!!O.argumentHint?.toLowerCase().includes(be)||O.description.toLowerCase().includes(be)||Array.isArray(O.tags)&&O.tags.some(we=>we.toLowerCase().includes(be));return he&&ye}):[],ie=I&&Z.length>0,L=O=>{T(`${O} `),f(!0),document.querySelector('[data-testid="agent-bar-input"]')?.focus()},Ee=O=>{const he=N.text,be=he.length>0&&!he.endsWith(" ")?`${he} ${O}`:`${he}${O}`;T(be),document.querySelector('[data-testid="agent-bar-input"]')?.focus()},fe=()=>l==="auto"?F:A.fleet?.members?.find(he=>he.role===l||he.instanceId===l)?.instanceId??F,Y=async()=>{const O=A.path,he=fe();if(O===null||he===void 0||r)return;const be=N.text;if(be.trim().length===0)return;const ye={text:be,refs:N.refs,revision:N.revision},we=N.pending!==void 0&&typeof N.pending.requestKey=="string"&&N.pending.requestKey.length>0&&N.pending.revision===N.revision?N.pending:void 0,Pe=we!==void 0?we.requestKey:crypto.randomUUID();w(Pe),s(!0),o(null),f(!0);try{const ue=await Ge(new Request(`${nt()}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:he,from:$u,body:cq(ye.text,ye.refs),requestKey:Pe,projectPath:O})}));if(!ue.ok)return;const at=(await ue.json().catch(()=>null))?.msgId;o(typeof at=="string"?at:null),k(ye.revision)}catch{}finally{s(!1)}};if(!t)return a.jsxs(a.Fragment,{children:[a.jsx("div",{role:"status","aria-live":"polite",className:"sr-only","data-agent-bar-live":!0,children:q}),a.jsx(Fe,{variant:"ghost",className:"fixed bottom-6 right-6 z-30 h-12 w-12 rounded-full backdrop-blur-md bg-base-100/80 border border-spur-border shadow-2xl text-xl text-spur-text",onClick:()=>n(!0),"aria-label":"Open agent prompt bar","aria-expanded":!1,"data-testid":"agent-bar-dock",children:"✨"})]});const me=A.fleet?.members&&A.fleet.members.length>0?[{id:"auto",label:"auto",desc:"Orchestrator auto-dispatch (default)"},...A.fleet.members.map(O=>({id:O.instanceId,label:O.role||O.instanceId,desc:`${O.executor}${O.model?` · ${O.model}`:""}`}))]:OK,te=N.text.trim().length===0||l==="auto"&&C;return a.jsxs("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-30 w-[calc(100vw-2rem)] max-w-[84rem] backdrop-blur-md bg-base-100/80 border border-spur-border shadow-2xl rounded-2xl p-2.5 flex flex-col gap-2 transition-colors","data-testid":"agent-bar",children:[a.jsx("div",{role:"status","aria-live":"polite",className:"sr-only","data-agent-bar-live":!0,children:q}),ie&&a.jsxs("div",{"data-testid":"agent-bar-palette",className:"w-full rounded-2xl bg-base-100/95 border border-spur-border shadow-2xl overflow-hidden flex flex-col backdrop-blur-2xl mb-1 transition-colors",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 border-b border-spur-border bg-base-200/50 text-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:"font-mono text-spur-accent font-semibold text-[13px]",children:"/"}),a.jsx("span",{className:"font-mono text-[12px] font-medium text-spur-text",children:"Commands"}),a.jsxs("span",{className:"text-[11px] font-mono text-spur-text-muted",children:[Z.length," available"]})]}),a.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar max-w-[65%] py-0.5",role:"tablist",children:S.slice(0,10).map(O=>a.jsx("button",{type:"button",role:"tab","aria-selected":x===O,onClick:()=>y(O),className:`px-2 py-0.5 rounded text-[11px] font-mono transition-colors shrink-0 cursor-pointer ${x===O?"bg-spur-accent/15 text-spur-accent border border-spur-accent/30 font-medium":"text-spur-text-muted hover:text-spur-text hover:bg-base-200"}`,children:O==="all"?"All":O},O))})]}),a.jsx("div",{className:"flex flex-col py-1.5 px-2 max-h-[260px] overflow-y-auto",role:"listbox",children:Z.map((O,he)=>{const be=he===m;return a.jsxs("button",{type:"button",role:"option","aria-selected":be,onClick:()=>L(O.name),title:O.description,className:`flex items-center w-full text-left px-3 py-2 rounded-lg cursor-pointer transition-colors ${be?"bg-spur-surface text-spur-accent font-medium":"hover:bg-base-200 text-spur-text-muted hover:text-spur-text"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[13px] min-w-0 truncate flex-1",children:[a.jsx("span",{className:be?"font-semibold text-spur-accent":"font-medium text-spur-text",children:O.name}),O.argumentHint?a.jsx("span",{className:`font-mono text-xs truncate ${be?"text-spur-text/80":"text-spur-text-muted"}`,children:O.argumentHint}):a.jsx("span",{className:`font-sans text-xs italic truncate ${be?"text-spur-text/60":"text-spur-text-muted/60"}`,children:O.description})]}),a.jsx("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:(O.tags&&O.tags.length>0?O.tags.slice(0,2):[O.category]).map(ye=>a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-base-200 text-spur-text-muted border border-spur-border",children:ye},ye))})]},O.name)})}),a.jsxs("div",{"data-testid":"agent-bar-hints",className:"flex items-center justify-between px-4 py-2 border-t border-spur-border bg-base-200/70 font-mono text-[11px] text-spur-text-muted select-none",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"↑↓"}),a.jsx("span",{children:"navigate"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"Tab"}),a.jsx("span",{children:"complete"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"↵"}),a.jsx("span",{children:"execute"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"ESC"}),a.jsx("span",{children:"dismiss"})]})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px]",children:[a.jsxs("button",{type:"button",onClick:()=>Ee("@"),className:"text-spur-text-muted hover:text-spur-accent cursor-pointer transition-colors flex items-center gap-0.5 group",title:"Reference files",children:[a.jsx("span",{className:"font-semibold text-spur-accent group-hover:underline",children:"@"}),a.jsx("span",{className:"group-hover:text-spur-text",children:"files"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("button",{type:"button",onClick:()=>Ee("#"),className:"text-spur-text-muted hover:text-spur-accent cursor-pointer transition-colors flex items-center gap-0.5 group",title:"Reference tasks and context",children:[a.jsx("span",{className:"font-semibold text-spur-accent group-hover:underline",children:"#"}),a.jsx("span",{className:"group-hover:text-spur-text",children:"context"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("button",{type:"button",onClick:()=>Ee("!"),className:"text-spur-text-muted hover:text-spur-accent cursor-pointer transition-colors flex items-center gap-0.5 group",title:"Execute shell directly",children:[a.jsx("span",{className:"font-semibold text-spur-accent group-hover:underline",children:"!"}),a.jsx("span",{className:"group-hover:text-spur-text",children:"bash"})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-spur-text-muted font-mono text-sm select-none font-bold pl-1",children:">"}),a.jsxs("div",{className:"relative shrink-0",ref:re,children:[a.jsxs("button",{type:"button",onClick:()=>d(O=>!O),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-spur-surface hover:bg-base-200 border border-spur-border text-xs font-mono text-spur-accent transition-colors cursor-pointer group",title:"Target Agent Receiver (default: auto dispatch to orchestrator)","data-testid":"agent-bar-role-tag",children:[a.jsx("span",{className:"text-spur-text-muted font-sans text-[11px]",children:"to:"}),a.jsx("span",{className:"font-semibold",children:l}),a.jsx("span",{className:"text-spur-text-muted text-[10px] group-hover:text-spur-text transition-colors",children:"▾"})]}),c&&a.jsxs("div",{"data-testid":"agent-bar-role-menu",className:"absolute bottom-full left-0 mb-2 w-56 rounded-xl bg-base-100 border border-spur-border shadow-2xl p-1.5 z-50 flex flex-col gap-1 text-spur-text",children:[a.jsx("div",{className:"px-2.5 py-1 text-[10px] font-mono text-spur-text-muted uppercase tracking-wider",children:"Dispatch Target"}),me.map(O=>a.jsxs("button",{type:"button",onClick:()=>{u(O.label),d(!1)},className:`flex items-center justify-between px-2.5 py-1.5 rounded-lg text-left text-xs font-mono transition-colors ${l===O.label?"bg-spur-accent/15 text-spur-accent font-semibold":"hover:bg-base-200 text-spur-text-muted hover:text-spur-text"}`,children:[a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"font-medium text-spur-text",children:O.label}),a.jsx("span",{className:"text-[10px] text-spur-text-muted",children:O.desc})]}),l===O.label&&a.jsx("span",{className:"text-[12px]",children:"✓"})]},O.id))]})]}),a.jsx(B7,{variant:"ghost",rows:1,value:N.text,onChange:O=>T(O.target.value),onKeyDown:O=>{if(ie&&Z.length>0){if(O.key==="ArrowDown"){O.preventDefault(),b(he=>(he+1)%Z.length);return}if(O.key==="ArrowUp"){O.preventDefault(),b(he=>(he-1+Z.length)%Z.length);return}if(O.key==="Tab"){O.preventDefault();const he=Z[m];he&&L(he.name);return}if(O.key==="Escape"){O.preventDefault(),f(!0);return}}RK(O)&&(te||(O.preventDefault(),Y()))},placeholder:"Ask a coding agent to refine or implement, or type / for commands…","aria-label":"Agent prompt",className:"flex-1 min-h-9 resize-none bg-transparent text-spur-text placeholder:text-spur-text-muted border-0 focus:ring-0 focus:outline-none","data-testid":"agent-bar-input"}),a.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),"aria-label":"Collapse agent prompt bar","aria-expanded":!0,className:"text-spur-text-muted hover:text-spur-text h-8 w-8 p-0 shrink-0",children:"▾"})]}),l==="auto"&&C&&a.jsx("div",{"data-testid":"agent-bar-orchestrator-missing",role:"status",className:"px-1 text-xs text-spur-text-muted",children:"Orchestrator unavailable — no orchestrator instance is bound to this project, so requests cannot be delivered yet."}),j&&a.jsxs("div",{"data-receipt-state":G,role:"status",className:`rounded-lg px-2.5 py-1 text-xs ${H.tone==="err"?"bg-spur-error/10 text-spur-error":H.tone==="warn"?"bg-spur-warning/10 text-spur-warning":"bg-spur-success/10 text-spur-success"}`,children:[a.jsx("span",{"aria-hidden":"true",className:"mr-1",children:H.icon}),a.jsx("span",{className:"font-medium",children:H.label}),a.jsxs("span",{className:"text-spur-text-muted",children:[" ","— ",H.meaning," Next: ",H.action,"."]}),z&&a.jsx("span",{className:"text-spur-text-muted",children:" (results feed unavailable)"})]})]})}function MK({name:e}){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o),t|=0;const n=Math.abs(t)%8,s=["text-emerald-400 bg-emerald-500/10 border-emerald-500/30","text-sky-400 bg-sky-500/10 border-sky-500/30","text-indigo-400 bg-indigo-500/10 border-indigo-500/30","text-amber-400 bg-amber-500/10 border-amber-500/30","text-rose-400 bg-rose-500/10 border-rose-500/30","text-purple-400 bg-purple-500/10 border-purple-500/30","text-teal-400 bg-teal-500/10 border-teal-500/30","text-cyan-400 bg-cyan-500/10 border-cyan-500/30"][n],i=()=>{switch(n){case 0:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M8 1.5l5.5 3.2v6.6L8 14.5l-5.5-3.2V4.7L8 1.5z"}),a.jsx("path",{d:"M8 1.5v13M2.5 4.7l5.5 3.3 5.5-3.3"})]});case 1:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"2",y:"2.5",width:"12",height:"11",rx:"2"}),a.jsx("path",{d:"M5 6l2.5 2L5 10M8.5 10H11"})]});case 2:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"4",r:"1.5"}),a.jsx("circle",{cx:"4.5",cy:"12",r:"1.5"}),a.jsx("circle",{cx:"11.5",cy:"7",r:"1.5"}),a.jsx("path",{d:"M4.5 5.5v5M4.5 7.5a4 4 0 004-1"})]});case 3:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M8 2l5.5 3-5.5 3-5.5-3L8 2z"}),a.jsx("path",{d:"M2.5 8l5.5 3 5.5-3M2.5 11l5.5 3 5.5-3"})]});case 4:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1.5"}),a.jsx("path",{d:"M6 1.5v2M10 1.5v2M6 12.5v2M10 12.5v2M1.5 6h2M1.5 10h2M12.5 6h2M12.5 10h2"})]});case 5:return a.jsx("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M5.5 4.5L2 8l3.5 3.5M10.5 4.5L14 8l-3.5 3.5M9 3l-2 10"})});case 6:return a.jsx("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M2 4a1.5 1.5 0 011.5-1.5h2.8a1.5 1.5 0 011.06.44l1.14 1.14c.28.28.66.42 1.06.42H12.5A1.5 1.5 0 0114 6v6a1.5 1.5 0 01-1.5 1.5h-9A1.5 1.5 0 012 12V4z"})});default:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"8",cy:"8",r:"6"}),a.jsx("path",{d:"M2 8h12M8 2a9 9 0 010 12 9 9 0 010-12z"})]})}};return a.jsx("span",{"data-testid":"project-avatar-icon",className:`flex h-7 w-7 items-center justify-center rounded border ${s}`,children:i()})}function w1({currentName:e,collapsed:t=!1}){const[n,r]=g.useState(!1),[s,i]=g.useState([]),[o,l]=g.useState(null),[u,c]=g.useState(null),d=g.useRef(null);g.useEffect(()=>{if(!n)return;const m=new AbortController;return Ge(new Request(`${nt()}/projects`,{signal:m.signal})).then(async b=>{if(!b.ok)return;const x=await b.json();i(x.projects??[])}).catch(()=>{c("Failed to load projects")}),()=>m.abort()},[n]),g.useEffect(()=>{if(!n)return;const m=x=>{x.key==="Escape"&&r(!1)},b=x=>{d.current&&!d.current.contains(x.target)&&r(!1)};return document.addEventListener("keydown",m),document.addEventListener("mousedown",b),()=>{document.removeEventListener("keydown",m),document.removeEventListener("mousedown",b)}},[n]);const p=async m=>{if(m.current){r(!1);return}if(m.running&&m.port>0){window.location.href=`http://localhost:${m.port}/board`;return}l(m.name);try{const b=await Ge(new Request(`${nt()}/projects/start`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:m.name,path:m.path})}));if(!b.ok)throw new Error("Failed to start project");const x=await b.json();window.location.href=x.url||`http://localhost:${x.port}/board`}catch(b){c(b instanceof Error?b.message:"Start failed"),l(null)}},f=a.jsxs("button",{type:"button",onClick:()=>r(m=>!m),"aria-haspopup":"listbox","aria-expanded":n,"aria-label":`Switch project: ${e}`,title:e,"data-testid":"project-switcher-trigger",className:"group relative flex h-8 w-8 items-center justify-center rounded-md hover:bg-spur-accent/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-spur-accent",children:[a.jsx("span",{className:`items-center justify-center ${n?"hidden":"flex group-hover:hidden"}`,children:a.jsx(MK,{name:e})}),a.jsx("span",{"data-testid":"project-switcher-chevron",className:`h-7 w-7 items-center justify-center rounded text-spur-text ${n?"flex":"hidden group-hover:flex"}`,children:a.jsx("svg",{className:`h-4 w-4 shrink-0 transition-transform ${n?"rotate-180 text-spur-accent":""}`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 6l4 4 4-4"})})})]});return a.jsxs("div",{className:`relative ${t?"flex items-center justify-center":"min-w-0 flex-1"}`,ref:d,children:[t?n?f:a.jsx(Br,{position:"right",tip:`Switch project: ${e}`,className:"block",children:f}):a.jsxs("button",{type:"button",onClick:()=>r(m=>!m),"aria-haspopup":"listbox","aria-expanded":n,"aria-label":"Switch project",title:e,"data-testid":"project-switcher-trigger",className:"flex w-full items-center justify-between gap-1 rounded-md px-1.5 py-1 text-left text-sm font-semibold text-spur-text hover:bg-spur-border/30 focus-visible:outline focus-visible:outline-2 focus-visible:outline-spur-accent",children:[a.jsx("span",{className:"font-semibold truncate",children:e}),a.jsx("svg",{className:`h-4 w-4 shrink-0 transition-transform ${n?"rotate-180":""}`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 6l4 4 4-4"})})]}),n&&a.jsxs("div",{role:"listbox","aria-label":"Registered projects","data-testid":"project-switcher-menu",className:`absolute z-50 w-64 rounded-md border border-spur-border bg-spur-surface p-1 shadow-lg ${t?"left-full top-0 ml-2":"left-0 top-full mt-1"}`,children:[a.jsx("div",{className:"px-2 py-1 text-xs font-medium text-spur-text-muted border-b border-spur-border/50 mb-1",children:"Projects"}),s.length===0?a.jsx("div",{className:"px-2 py-1.5 text-xs text-spur-text-muted",children:u||"No projects registered"}):s.map(m=>a.jsxs("button",{type:"button",role:"option","aria-selected":m.current,disabled:o===m.name,onClick:()=>p(m),"data-testid":`project-item-${m.name}`,className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-xs text-left transition-colors ${m.current?"bg-spur-accent/15 text-spur-accent font-medium":"text-spur-text hover:bg-spur-border/30"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:`h-2 w-2 rounded-full shrink-0 ${m.running?"bg-green-500":"bg-gray-400"}`,title:m.running?`Running on port ${m.port}`:"Stopped"}),a.jsx("span",{className:"truncate",children:m.name})]}),o===m.name?a.jsx("span",{className:"text-[10px] text-spur-accent animate-pulse",children:"Starting..."}):m.current?a.jsx("span",{className:"text-[10px] font-semibold text-spur-accent",children:"current"}):m.running?a.jsxs("span",{className:"text-[10px] text-spur-text-muted",children:[":",m.port]}):a.jsx("span",{className:"text-[10px] text-spur-text-muted",children:"stopped"})]},m.path))]})]})}const AA="spur-theme";function FK(){try{const e=localStorage.getItem(AA);if(e==="light"||e==="dark")return e}catch{}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function PK(e){document.documentElement.setAttribute("data-theme",e);try{localStorage.setItem(AA,e)}catch{}}function BK(e){const t=e==="dark"?"light":"dark";return PK(t),t}function v1(){const[e,t]=g.useState(FK);g.useEffect(()=>{const r=window.matchMedia("(prefers-color-scheme: dark)"),s=i=>{if(!(()=>{try{return localStorage.getItem("spur-theme")}catch{return null}})()){const l=i.matches?"dark":"light";t(l),document.documentElement.setAttribute("data-theme",l)}};return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[]);const n=g.useCallback(()=>t(BK),[]);return a.jsx(Fe,{variant:"ghost",size:"sm",onClick:n,className:"text-spur-text-muted","aria-label":e==="dark"?"Switch to light mode":"Switch to dark mode",children:e==="dark"?"☀️":"🌙"})}const UK="Modules";function $K(){const[e,t]=g.useState(UK);return g.useEffect(()=>{const n=new AbortController;return Ge(new Request(`${nt()}/project`,{signal:n.signal})).then(async r=>{if(!r.ok)return;const s=await r.json();s.name&&t(s.name)}).catch(()=>{}),()=>n.abort()},[]),e}function zK({direction:e}){const t=e==="expand";return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),a.jsx("line",{x1:"6",y1:"2",x2:"6",y2:"14"}),t?a.jsx("path",{d:"M9 6l2 2-2 2"}):a.jsx("path",{d:"M11 6l-2 2 2 2"})]})}function A1({collapsed:e,onToggle:t}){const n=e?"Expand sidebar":"Collapse sidebar";return a.jsx("button",{type:"button",onClick:t,"aria-label":n,title:n,"data-testid":e?"sidebar-expand":"sidebar-collapse",className:"flex h-8 w-8 items-center justify-center rounded-md text-spur-text-muted hover:bg-spur-accent/20 hover:text-spur-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-spur-accent",children:a.jsx(zK,{direction:e?"expand":"collapse"})})}function k1({collapsed:e}){const t=a.jsx(C1,{to:"/board/settings","aria-label":"Open settings",title:"Open settings","data-testid":"sidebar-settings",className:({isActive:n})=>`flex h-8 w-8 items-center justify-center rounded-md transition-colors ${n?"bg-spur-accent/20 text-spur-accent":"text-spur-text-muted hover:bg-spur-accent/20 hover:text-spur-accent"} focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-spur-accent`,children:a.jsx("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})});return e?a.jsx(Br,{position:"right",tip:"Settings",className:"block",children:t}):t}function HK({collapsed:e,onToggle:t,onMobileClose:n}){const r=$K(),{registry:s}=NA();return a.jsxs("aside",{className:`flex flex-col bg-spur-surface border-r border-spur-border ${e?"overflow-visible":"overflow-hidden"}`,children:[e?a.jsx("div",{className:"flex items-center justify-center border-b border-spur-border shrink-0 py-2",children:a.jsx(w1,{currentName:r,collapsed:!0})}):a.jsxs("div",{className:"flex items-center justify-between gap-1 p-3 border-b border-spur-border shrink-0",children:[a.jsx(w1,{currentName:r}),n&&a.jsx(Fe,{variant:"ghost",size:"sm",className:"text-spur-text-muted md:hidden",onClick:n,"aria-label":"Close navigation",children:"✕"})]}),a.jsx("nav",{className:`flex-1 ${e?"overflow-visible":"overflow-y-auto"}`,children:s.modules.filter(i=>i.id!=="settings").map(i=>{const o=i.sidebarLabel??i.name,l=a.jsxs(C1,{to:`/board/${i.route}`,className:({isActive:u})=>`flex items-center gap-2 px-3 py-2 text-sm transition-colors ${u?"bg-spur-accent/20 text-spur-accent":"text-spur-text-muted hover:text-spur-text hover:bg-spur-border/30"} ${e?"justify-center py-3":""}`,children:[a.jsx("span",{className:"text-lg",children:i.icon}),!e&&a.jsx("span",{children:o})]},i.id);if(e){const u=i.description?`${o}
|
|
321
|
+
`},OV={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function LV(e){let{announcements:t=OV,container:n,hiddenTextDescribedById:r,screenReaderInstructions:s=DV}=e;const{announce:i,announcement:o}=CV(),l=Gu("DndLiveRegion"),[u,c]=g.useState(!1);if(g.useEffect(()=>{c(!0)},[]),IV(g.useMemo(()=>({onDragStart(p){let{active:f}=p;i(t.onDragStart({active:f}))},onDragMove(p){let{active:f,over:m}=p;t.onDragMove&&i(t.onDragMove({active:f,over:m}))},onDragOver(p){let{active:f,over:m}=p;i(t.onDragOver({active:f,over:m}))},onDragEnd(p){let{active:f,over:m}=p;i(t.onDragEnd({active:f,over:m}))},onDragCancel(p){let{active:f,over:m}=p;i(t.onDragCancel({active:f,over:m}))}}),[i,t])),!u)return null;const d=Ve.createElement(Ve.Fragment,null,Ve.createElement(kV,{id:r,value:s.draggable}),Ve.createElement(_V,{id:l,announcement:o}));return n?Or.createPortal(d,n):d}var Yt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(Yt||(Yt={}));function Ul(){}function l1(e,t){return g.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function jV(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return g.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Vn=Object.freeze({x:0,y:0});function MV(e,t){const n=Bl(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function FV(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function PV(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function BV(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),o=s-r,l=i-n;if(r<s&&n<i){const u=t.width*t.height,c=e.width*e.height,d=o*l,p=d/(u+c-d);return Number(p.toFixed(4))}return 0}const UV=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const s=[];for(const i of r){const{id:o}=i,l=n.get(o);if(l){const u=BV(l,t);u>0&&s.push({id:o,data:{droppableContainer:i,value:u}})}}return s.sort(FV)};function $V(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function eA(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Vn}function zV(e){return function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),i=1;i<r;i++)s[i-1]=arguments[i];return s.reduce((o,l)=>({...o,top:o.top+e*l.y,bottom:o.bottom+e*l.y,left:o.left+e*l.x,right:o.right+e*l.x}),{...n})}}const HV=zV(1);function tA(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function GV(e,t,n){const r=tA(t);if(!r)return e;const{scaleX:s,scaleY:i,x:o,y:l}=r,u=e.left-o-(1-s)*parseFloat(n),c=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),d=s?e.width/s:e.width,p=i?e.height/i:e.height;return{width:d,height:p,top:c,right:u+d,bottom:c+p,left:u}}const WV={ignoreTransform:!1};function lo(e,t){t===void 0&&(t=WV);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Tn(e).getComputedStyle(e);c&&(n=GV(n,c,d))}const{top:r,left:s,width:i,height:o,bottom:l,right:u}=n;return{top:r,left:s,width:i,height:o,bottom:l,right:u}}function u1(e){return lo(e,{ignoreTransform:!0})}function qV(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function VV(e,t){return t===void 0&&(t=Tn(e).getComputedStyle(e)),t.position==="fixed"}function YV(e,t){t===void 0&&(t=Tn(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function px(e,t){const n=[];function r(s){if(t!=null&&n.length>=t||!s)return n;if(cx(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!io(s)||Xv(s)||n.includes(s))return n;const i=Tn(e).getComputedStyle(s);return s!==e&&YV(s,i)&&n.push(s),VV(s,i)?n:r(s.parentNode)}return e?r(e):n}function nA(e){const[t]=px(e,1);return t??null}function rd(e){return!zu||!e?null:Ca(e)?e:ux(e)?cx(e)||e===Ia(e).scrollingElement?window:io(e)?e:null:null}function rA(e){return Ca(e)?e.scrollX:e.scrollLeft}function sA(e){return Ca(e)?e.scrollY:e.scrollTop}function tp(e){return{x:rA(e),y:sA(e)}}var tn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(tn||(tn={}));function aA(e){return!zu||!e?!1:e===document.scrollingElement}function iA(e){const t={x:0,y:0},n=aA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,o=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:s,isLeft:i,isBottom:o,isRight:l,maxScroll:r,minScroll:t}}const KV={x:.2,y:.2};function ZV(e,t,n,r,s){let{top:i,left:o,right:l,bottom:u}=n;r===void 0&&(r=10),s===void 0&&(s=KV);const{isTop:c,isBottom:d,isLeft:p,isRight:f}=iA(e),m={x:0,y:0},b={x:0,y:0},x={height:t.height*s.y,width:t.width*s.x};return!c&&i<=t.top+x.height?(m.y=tn.Backward,b.y=r*Math.abs((t.top+x.height-i)/x.height)):!d&&u>=t.bottom-x.height&&(m.y=tn.Forward,b.y=r*Math.abs((t.bottom-x.height-u)/x.height)),!f&&l>=t.right-x.width?(m.x=tn.Forward,b.x=r*Math.abs((t.right-x.width-l)/x.width)):!p&&o<=t.left+x.width&&(m.x=tn.Backward,b.x=r*Math.abs((t.left+x.width-o)/x.width)),{direction:m,speed:b}}function XV(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:o}=window;return{top:0,left:0,right:i,bottom:o,width:i,height:o}}const{top:t,left:n,right:r,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:s,width:e.clientWidth,height:e.clientHeight}}function oA(e){return e.reduce((t,n)=>Js(t,tp(n)),Vn)}function QV(e){return e.reduce((t,n)=>t+rA(n),0)}function JV(e){return e.reduce((t,n)=>t+sA(n),0)}function lA(e,t){if(t===void 0&&(t=lo),!e)return;const{top:n,left:r,bottom:s,right:i}=t(e);nA(e)&&(s<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const eY=[["x",["left","right"],QV],["y",["top","bottom"],JV]];class fx{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=px(n),s=oA(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,o,l]of eY)for(const u of o)Object.defineProperty(this,u,{get:()=>{const c=l(r),d=s[i]-c;return this.rect[u]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class mi{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var s;(s=this.target)==null||s.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function tY(e){const{EventTarget:t}=Tn(e);return e instanceof t?e:Ia(e)}function sd(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var Ln;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Ln||(Ln={}));function c1(e){e.preventDefault()}function nY(e){e.stopPropagation()}var St;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(St||(St={}));const uA={start:[St.Space,St.Enter],cancel:[St.Esc],end:[St.Space,St.Enter,St.Tab]},rY=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case St.Right:return{...n,x:n.x+25};case St.Left:return{...n,x:n.x-25};case St.Down:return{...n,y:n.y+25};case St.Up:return{...n,y:n.y-25}}};class mx{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new mi(Ia(n)),this.windowListeners=new mi(Tn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Ln.Resize,this.handleCancel),this.windowListeners.add(Ln.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Ln.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&lA(r),n(Vn)}handleKeyDown(t){if(dx(t)){const{active:n,context:r,options:s}=this.props,{keyboardCodes:i=uA,coordinateGetter:o=rY,scrollBehavior:l="smooth"}=s,{code:u}=t;if(i.end.includes(u)){this.handleEnd(t);return}if(i.cancel.includes(u)){this.handleCancel(t);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:Vn;this.referenceCoordinates||(this.referenceCoordinates=d);const p=o(t,{active:n,context:r.current,currentCoordinates:d});if(p){const f=Pl(p,d),m={x:0,y:0},{scrollableAncestors:b}=r.current;for(const x of b){const y=t.code,{isTop:E,isRight:v,isLeft:S,isBottom:A,maxScroll:N,minScroll:T}=iA(x),w=XV(x),k={x:Math.min(y===St.Right?w.right-w.width/2:w.right,Math.max(y===St.Right?w.left:w.left+w.width/2,p.x)),y:Math.min(y===St.Down?w.bottom-w.height/2:w.bottom,Math.max(y===St.Down?w.top:w.top+w.height/2,p.y))},F=y===St.Right&&!v||y===St.Left&&!S,C=y===St.Down&&!A||y===St.Up&&!E;if(F&&k.x!==p.x){const $=x.scrollLeft+f.x,z=y===St.Right&&$<=N.x||y===St.Left&&$>=T.x;if(z&&!f.y){x.scrollTo({left:$,behavior:l});return}z?m.x=x.scrollLeft-$:m.x=y===St.Right?x.scrollLeft-N.x:x.scrollLeft-T.x,m.x&&x.scrollBy({left:-m.x,behavior:l});break}else if(C&&k.y!==p.y){const $=x.scrollTop+f.y,z=y===St.Down&&$<=N.y||y===St.Up&&$>=T.y;if(z&&!f.x){x.scrollTo({top:$,behavior:l});return}z?m.y=x.scrollTop-$:m.y=y===St.Down?x.scrollTop-N.y:x.scrollTop-T.y,m.y&&x.scrollBy({top:-m.y,behavior:l});break}}this.handleMove(t,Js(Pl(p,this.referenceCoordinates),m))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}mx.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=uA,onActivation:s}=t,{active:i}=n;const{code:o}=e.nativeEvent;if(r.start.includes(o)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),s?.({event:e.nativeEvent}),!0)}return!1}}];function d1(e){return!!(e&&"distance"in e)}function p1(e){return!!(e&&"delay"in e)}class hx{constructor(t,n,r){var s;r===void 0&&(r=tY(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:o}=i;this.props=t,this.events=n,this.document=Ia(o),this.documentListeners=new mi(this.document),this.listeners=new mi(r),this.windowListeners=new mi(Tn(o)),this.initialCoordinates=(s=Bl(i))!=null?s:Vn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Ln.Resize,this.handleCancel),this.windowListeners.add(Ln.DragStart,c1),this.windowListeners.add(Ln.VisibilityChange,this.handleCancel),this.windowListeners.add(Ln.ContextMenu,c1),this.documentListeners.add(Ln.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(p1(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(d1(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:s}=this.props;s(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Ln.Click,nY,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Ln.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:s,props:i}=this,{onMove:o,options:{activationConstraint:l}}=i;if(!s)return;const u=(n=Bl(t))!=null?n:Vn,c=Pl(s,u);if(!r&&l){if(d1(l)){if(l.tolerance!=null&&sd(c,l.tolerance))return this.handleCancel();if(sd(c,l.distance))return this.handleStart()}if(p1(l)&&sd(c,l.tolerance))return this.handleCancel();this.handlePending(l,c);return}t.cancelable&&t.preventDefault(),o(u)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===St.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const sY={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class gx extends hx{constructor(t){const{event:n}=t,r=Ia(n.target);super(t,sY,r)}}gx.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];const aY={move:{name:"mousemove"},end:{name:"mouseup"}};var np;(function(e){e[e.RightClick=2]="RightClick"})(np||(np={}));class iY extends hx{constructor(t){super(t,aY,Ia(t.event.target))}}iY.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===np.RightClick?!1:(r?.({event:n}),!0)}}];const ad={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class oY extends hx{constructor(t){super(t,ad)}static setup(){return window.addEventListener(ad.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ad.move.name,t)};function t(){}}}oY.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:s}=n;return s.length>1?!1:(r?.({event:n}),!0)}}];var hi;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(hi||(hi={}));var $l;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})($l||($l={}));function lY(e){let{acceleration:t,activator:n=hi.Pointer,canScroll:r,draggingRect:s,enabled:i,interval:o=5,order:l=$l.TreeOrder,pointerCoordinates:u,scrollableAncestors:c,scrollableAncestorRects:d,delta:p,threshold:f}=e;const m=cY({delta:p,disabled:!i}),[b,x]=TV(),y=g.useRef({x:0,y:0}),E=g.useRef({x:0,y:0}),v=g.useMemo(()=>{switch(n){case hi.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case hi.DraggableRect:return s}},[n,s,u]),S=g.useRef(null),A=g.useCallback(()=>{const T=S.current;if(!T)return;const w=y.current.x*E.current.x,k=y.current.y*E.current.y;T.scrollBy(w,k)},[]),N=g.useMemo(()=>l===$l.TreeOrder?[...c].reverse():c,[l,c]);g.useEffect(()=>{if(!i||!c.length||!v){x();return}for(const T of N){if(r?.(T)===!1)continue;const w=c.indexOf(T),k=d[w];if(!k)continue;const{direction:F,speed:C}=ZV(T,k,v,t,f);for(const $ of["x","y"])m[$][F[$]]||(C[$]=0,F[$]=0);if(C.x>0||C.y>0){x(),S.current=T,b(A,o),y.current=C,E.current=F;return}}y.current={x:0,y:0},E.current={x:0,y:0},x()},[t,A,r,x,i,o,JSON.stringify(v),JSON.stringify(m),b,c,N,d,JSON.stringify(f)])}const uY={x:{[tn.Backward]:!1,[tn.Forward]:!1},y:{[tn.Backward]:!1,[tn.Forward]:!1}};function cY(e){let{delta:t,disabled:n}=e;const r=Fl(t);return oo(s=>{if(n||!r||!s)return uY;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[tn.Backward]:s.x[tn.Backward]||i.x===-1,[tn.Forward]:s.x[tn.Forward]||i.x===1},y:{[tn.Backward]:s.y[tn.Backward]||i.y===-1,[tn.Forward]:s.y[tn.Forward]||i.y===1}}},[n,t,r])}function dY(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return oo(s=>{var i;return t==null?null:(i=r??s)!=null?i:null},[r,t])}function pY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{const{sensor:s}=r,i=s.activators.map(o=>({eventName:o.eventName,handler:t(o.handler,r)}));return[...n,...i]},[]),[e,t])}var Mi;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Mi||(Mi={}));var rp;(function(e){e.Optimized="optimized"})(rp||(rp={}));const f1=new Map;function fY(e,t){let{dragging:n,dependencies:r,config:s}=t;const[i,o]=g.useState(null),{frequency:l,measure:u,strategy:c}=s,d=g.useRef(e),p=y(),f=ji(p),m=g.useCallback(function(E){E===void 0&&(E=[]),!f.current&&o(v=>v===null?E:v.concat(E.filter(S=>!v.includes(S))))},[f]),b=g.useRef(null),x=oo(E=>{if(p&&!n)return f1;if(!E||E===f1||d.current!==e||i!=null){const v=new Map;for(let S of e){if(!S)continue;if(i&&i.length>0&&!i.includes(S.id)&&S.rect.current){v.set(S.id,S.rect.current);continue}const A=S.node.current,N=A?new fx(u(A),A):null;S.rect.current=N,N&&v.set(S.id,N)}return v}return E},[e,i,n,p,u]);return g.useEffect(()=>{d.current=e},[e]),g.useEffect(()=>{p||m()},[n,p]),g.useEffect(()=>{i&&i.length>0&&o(null)},[JSON.stringify(i)]),g.useEffect(()=>{p||typeof l!="number"||b.current!==null||(b.current=setTimeout(()=>{m(),b.current=null},l))},[l,p,m,...r]),{droppableRects:x,measureDroppableContainers:m,measuringScheduled:i!=null};function y(){switch(c){case Mi.Always:return!1;case Mi.BeforeDragging:return n;default:return!n}}}function bx(e,t){return oo(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function mY(e,t){return bx(e,t)}function hY(e){let{callback:t,disabled:n}=e;const r=Hu(t),s=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return g.useEffect(()=>()=>s?.disconnect(),[s]),s}function Wu(e){let{callback:t,disabled:n}=e;const r=Hu(t),s=g.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return g.useEffect(()=>()=>s?.disconnect(),[s]),s}function gY(e){return new fx(lo(e),e)}function m1(e,t,n){t===void 0&&(t=gY);const[r,s]=g.useState(null);function i(){s(u=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=u??n)!=null?c:null}const d=t(e);return JSON.stringify(u)===JSON.stringify(d)?u:d})}const o=hY({callback(u){if(e)for(const c of u){const{type:d,target:p}=c;if(d==="childList"&&p instanceof HTMLElement&&p.contains(e)){i();break}}}}),l=Wu({callback:i});return Tr(()=>{i(),e?(l?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),o?.disconnect())},[e]),r}function bY(e){const t=bx(e);return eA(e,t)}const h1=[];function xY(e){const t=g.useRef(e),n=oo(r=>e?r&&r!==h1&&e&&t.current&&e.parentNode===t.current.parentNode?r:px(e):h1,[e]);return g.useEffect(()=>{t.current=e},[e]),n}function yY(e){const[t,n]=g.useState(null),r=g.useRef(e),s=g.useCallback(i=>{const o=rd(i.target);o&&n(l=>l?(l.set(o,tp(o)),new Map(l)):null)},[]);return g.useEffect(()=>{const i=r.current;if(e!==i){o(i);const l=e.map(u=>{const c=rd(u);return c?(c.addEventListener("scroll",s,{passive:!0}),[c,tp(c)]):null}).filter(u=>u!=null);n(l.length?new Map(l):null),r.current=e}return()=>{o(e),o(i)};function o(l){l.forEach(u=>{const c=rd(u);c?.removeEventListener("scroll",s)})}},[s,e]),g.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,o)=>Js(i,o),Vn):oA(e):Vn,[e,t])}function g1(e,t){t===void 0&&(t=[]);const n=g.useRef(null);return g.useEffect(()=>{n.current=null},t),g.useEffect(()=>{const r=e!==Vn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Pl(e,n.current):Vn}function EY(e){g.useEffect(()=>{if(!zu)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function SY(e,t){return g.useMemo(()=>e.reduce((n,r)=>{let{eventName:s,handler:i}=r;return n[s]=o=>{i(o,t)},n},{}),[e,t])}function cA(e){return g.useMemo(()=>e?qV(e):null,[e])}const b1=[];function TY(e,t){t===void 0&&(t=lo);const[n]=e,r=cA(n?Tn(n):null),[s,i]=g.useState(b1);function o(){i(()=>e.length?e.map(u=>aA(u)?r:new fx(t(u),u)):b1)}const l=Wu({callback:o});return Tr(()=>{l?.disconnect(),o(),e.forEach(u=>l?.observe(u))},[e]),s}function dA(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return io(t)?t:e}function NY(e){let{measure:t}=e;const[n,r]=g.useState(null),s=g.useCallback(c=>{for(const{target:d}of c)if(io(d)){r(p=>{const f=t(d);return p?{...p,width:f.width,height:f.height}:f});break}},[t]),i=Wu({callback:s}),o=g.useCallback(c=>{const d=dA(c);i?.disconnect(),d&&i?.observe(d),r(d?t(d):null)},[t,i]),[l,u]=Ml(o);return g.useMemo(()=>({nodeRef:l,rect:n,setRef:u}),[n,l,u])}const wY=[{sensor:gx,options:{}},{sensor:mx,options:{}}],vY={current:{}},ll={draggable:{measure:u1},droppable:{measure:u1,strategy:Mi.WhileDragging,frequency:rp.Optimized},dragOverlay:{measure:lo}};class gi extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const AY={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new gi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ul},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ll,measureDroppableContainers:Ul,windowRect:null,measuringScheduled:!1},pA={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ul,draggableNodes:new Map,over:null,measureDroppableContainers:Ul},uo=g.createContext(pA),fA=g.createContext(AY);function kY(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new gi}}}function _Y(e,t){switch(t.type){case Yt.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Yt.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Yt.DragEnd:case Yt.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Yt.RegisterDroppable:{const{element:n}=t,{id:r}=n,s=new gi(e.droppable.containers);return s.set(r,n),{...e,droppable:{...e.droppable,containers:s}}}case Yt.SetDroppableDisabled:{const{id:n,key:r,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new gi(e.droppable.containers);return o.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:o}}}case Yt.UnregisterDroppable:{const{id:n,key:r}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new gi(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function CY(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:s}=g.useContext(uo),i=Fl(r),o=Fl(n?.id);return g.useEffect(()=>{if(!t&&!r&&i&&o!=null){if(!dx(i)||document.activeElement===i.target)return;const l=s.get(o);if(!l)return;const{activatorNode:u,node:c}=l;if(!u.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[u.current,c.current]){if(!d)continue;const p=vV(d);if(p){p.focus();break}}})}},[r,t,s,o,i]),null}function mA(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...r}),n):n}function IY(e){return g.useMemo(()=>({draggable:{...ll.draggable,...e?.draggable},droppable:{...ll.droppable,...e?.droppable},dragOverlay:{...ll.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function RY(e){let{activeNode:t,measure:n,initialRect:r,config:s=!0}=e;const i=g.useRef(!1),{x:o,y:l}=typeof s=="boolean"?{x:s,y:s}:s;Tr(()=>{if(!o&&!l||!t){i.current=!1;return}if(i.current||!r)return;const c=t?.node.current;if(!c||c.isConnected===!1)return;const d=n(c),p=eA(d,r);if(o||(p.x=0),l||(p.y=0),i.current=!0,Math.abs(p.x)>0||Math.abs(p.y)>0){const f=nA(c);f&&f.scrollBy({top:p.y,left:p.x})}},[t,o,l,r,n])}const qu=g.createContext({...Vn,scaleX:1,scaleY:1});var Rr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Rr||(Rr={}));const DY=g.memo(function(t){var n,r,s,i;let{id:o,accessibility:l,autoScroll:u=!0,children:c,sensors:d=wY,collisionDetection:p=UV,measuring:f,modifiers:m,...b}=t;const x=g.useReducer(_Y,void 0,kY),[y,E]=x,[v,S]=RV(),[A,N]=g.useState(Rr.Uninitialized),T=A===Rr.Initialized,{draggable:{active:w,nodes:k,translate:F},droppable:{containers:C}}=y,$=w!=null?k.get(w):null,z=g.useRef({initial:null,translated:null}),M=g.useMemo(()=>{var ve;return w!=null?{id:w,data:(ve=$?.data)!=null?ve:vY,rect:z}:null},[w,$]),G=g.useRef(null),[H,j]=g.useState(null),[q,re]=g.useState(null),pe=ji(b,Object.values(b)),I=Gu("DndDescribedBy",o),Z=g.useMemo(()=>C.getEnabled(),[C]),ie=IY(f),{droppableRects:L,measureDroppableContainers:Ee,measuringScheduled:fe}=fY(Z,{dragging:T,dependencies:[F.x,F.y],config:ie.droppable}),Y=dY(k,w),me=g.useMemo(()=>q?Bl(q):null,[q]),te=Ft(),O=mY(Y,ie.draggable.measure);RY({activeNode:w!=null?k.get(w):null,config:te.layoutShiftCompensation,initialRect:O,measure:ie.draggable.measure});const he=m1(Y,ie.draggable.measure,O),be=m1(Y?Y.parentElement:null),ye=g.useRef({activatorEvent:null,active:null,activeNode:Y,collisionRect:null,collisions:null,droppableRects:L,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:C,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),we=C.getNodeFor((n=ye.current.over)==null?void 0:n.id),Pe=NY({measure:ie.dragOverlay.measure}),ue=(r=Pe.nodeRef.current)!=null?r:Y,Ye=T?(s=Pe.rect)!=null?s:he:null,at=!!(Pe.nodeRef.current&&Pe.rect),Qe=bY(at?null:he),At=cA(ue?Tn(ue):null),ft=xY(T?we??Y:null),dt=TY(ft),Ot=mA(m,{transform:{x:F.x-Qe.x,y:F.y-Qe.y,scaleX:1,scaleY:1},activatorEvent:q,active:M,activeNodeRect:he,containerNodeRect:be,draggingNodeRect:Ye,over:ye.current.over,overlayNodeRect:Pe.rect,scrollableAncestors:ft,scrollableAncestorRects:dt,windowRect:At}),qe=me?Js(me,F):null,De=yY(ft),Ke=g1(De),Q=g1(De,[he]),le=Js(Ot,Ke),Ae=Ye?HV(Ye,Ot):null,W=M&&Ae?p({active:M,collisionRect:Ae,droppableRects:L,droppableContainers:Z,pointerCoordinates:qe}):null,_e=PV(W,"id"),[Be,ut]=g.useState(null),mt=at?Ot:Js(Ot,Q),kt=$V(mt,(i=Be?.rect)!=null?i:null,he),yt=g.useRef(null),oe=g.useCallback((ve,He)=>{let{sensor:$e,options:bt}=He;if(G.current==null)return;const ne=k.get(G.current);if(!ne)return;const de=ve.nativeEvent,st=new $e({active:G.current,activeNode:ne,event:de,options:bt,context:ye,onAbort(V){if(!k.get(V))return;const{onDragAbort:Ze}=pe.current,pt={id:V};Ze?.(pt),v({type:"onDragAbort",event:pt})},onPending(V,Me,Ze,pt){if(!k.get(V))return;const{onDragPending:pr}=pe.current,Qn={id:V,constraint:Me,initialCoordinates:Ze,offset:pt};pr?.(Qn),v({type:"onDragPending",event:Qn})},onStart(V){const Me=G.current;if(Me==null)return;const Ze=k.get(Me);if(!Ze)return;const{onDragStart:pt}=pe.current,_n={activatorEvent:de,active:{id:Me,data:Ze.data,rect:z}};Or.unstable_batchedUpdates(()=>{pt?.(_n),N(Rr.Initializing),E({type:Yt.DragStart,initialCoordinates:V,active:Me}),v({type:"onDragStart",event:_n}),j(yt.current),re(de)})},onMove(V){E({type:Yt.DragMove,coordinates:V})},onEnd:wt(Yt.DragEnd),onCancel:wt(Yt.DragCancel)});yt.current=st;function wt(V){return async function(){const{active:Ze,collisions:pt,over:_n,scrollAdjustedTranslate:pr}=ye.current;let Qn=null;if(Ze&&pr){const{cancelDrop:zn}=pe.current;Qn={activatorEvent:de,active:Ze,collisions:pt,delta:pr,over:_n},V===Yt.DragEnd&&typeof zn=="function"&&await Promise.resolve(zn(Qn))&&(V=Yt.DragCancel)}G.current=null,Or.unstable_batchedUpdates(()=>{E({type:V}),N(Rr.Uninitialized),ut(null),j(null),re(null),yt.current=null;const zn=V===Yt.DragEnd?"onDragEnd":"onDragCancel";if(Qn){const Ra=pe.current[zn];Ra?.(Qn),v({type:zn,event:Qn})}})}}},[k]),Ne=g.useCallback((ve,He)=>($e,bt)=>{const ne=$e.nativeEvent,de=k.get(bt);if(G.current!==null||!de||ne.dndKit||ne.defaultPrevented)return;const st={active:de};ve($e,He.options,st)===!0&&(ne.dndKit={capturedBy:He.sensor},G.current=bt,oe($e,He))},[k,oe]),je=pY(d,Ne);EY(d),Tr(()=>{he&&A===Rr.Initializing&&N(Rr.Initialized)},[he,A]),g.useEffect(()=>{const{onDragMove:ve}=pe.current,{active:He,activatorEvent:$e,collisions:bt,over:ne}=ye.current;if(!He||!$e)return;const de={active:He,activatorEvent:$e,collisions:bt,delta:{x:le.x,y:le.y},over:ne};Or.unstable_batchedUpdates(()=>{ve?.(de),v({type:"onDragMove",event:de})})},[le.x,le.y]),g.useEffect(()=>{const{active:ve,activatorEvent:He,collisions:$e,droppableContainers:bt,scrollAdjustedTranslate:ne}=ye.current;if(!ve||G.current==null||!He||!ne)return;const{onDragOver:de}=pe.current,st=bt.get(_e),wt=st&&st.rect.current?{id:st.id,rect:st.rect.current,data:st.data,disabled:st.disabled}:null,V={active:ve,activatorEvent:He,collisions:$e,delta:{x:ne.x,y:ne.y},over:wt};Or.unstable_batchedUpdates(()=>{ut(wt),de?.(V),v({type:"onDragOver",event:V})})},[_e]),Tr(()=>{ye.current={activatorEvent:q,active:M,activeNode:Y,collisionRect:Ae,collisions:W,droppableRects:L,draggableNodes:k,draggingNode:ue,draggingNodeRect:Ye,droppableContainers:C,over:Be,scrollableAncestors:ft,scrollAdjustedTranslate:le},z.current={initial:Ye,translated:Ae}},[M,Y,W,Ae,k,ue,Ye,L,C,Be,ft,le]),lY({...te,delta:F,draggingRect:Ae,pointerCoordinates:qe,scrollableAncestors:ft,scrollableAncestorRects:dt});const Ie=g.useMemo(()=>({active:M,activeNode:Y,activeNodeRect:he,activatorEvent:q,collisions:W,containerNodeRect:be,dragOverlay:Pe,draggableNodes:k,droppableContainers:C,droppableRects:L,over:Be,measureDroppableContainers:Ee,scrollableAncestors:ft,scrollableAncestorRects:dt,measuringConfiguration:ie,measuringScheduled:fe,windowRect:At}),[M,Y,he,q,W,be,Pe,k,C,L,Be,Ee,ft,dt,ie,fe,At]),gt=g.useMemo(()=>({activatorEvent:q,activators:je,active:M,activeNodeRect:he,ariaDescribedById:{draggable:I},dispatch:E,draggableNodes:k,over:Be,measureDroppableContainers:Ee}),[q,je,M,he,E,I,k,Be,Ee]);return Ve.createElement(Jv.Provider,{value:S},Ve.createElement(uo.Provider,{value:gt},Ve.createElement(fA.Provider,{value:Ie},Ve.createElement(qu.Provider,{value:kt},c)),Ve.createElement(CY,{disabled:l?.restoreFocus===!1})),Ve.createElement(LV,{...l,hiddenTextDescribedById:I}));function Ft(){const ve=H?.autoScrollEnabled===!1,He=typeof u=="object"?u.enabled===!1:u===!1,$e=T&&!ve&&!He;return typeof u=="object"?{...u,enabled:$e}:{enabled:$e}}}),OY=g.createContext(null),x1="button",LY="Draggable";function jY(e){let{id:t,data:n,disabled:r=!1,attributes:s}=e;const i=Gu(LY),{activators:o,activatorEvent:l,active:u,activeNodeRect:c,ariaDescribedById:d,draggableNodes:p,over:f}=g.useContext(uo),{role:m=x1,roleDescription:b="draggable",tabIndex:x=0}=s??{},y=u?.id===t,E=g.useContext(y?qu:OY),[v,S]=Ml(),[A,N]=Ml(),T=SY(o,t),w=ji(n);Tr(()=>(p.set(t,{id:t,key:i,node:v,activatorNode:A,data:w}),()=>{const F=p.get(t);F&&F.key===i&&p.delete(t)}),[p,t]);const k=g.useMemo(()=>({role:m,tabIndex:x,"aria-disabled":r,"aria-pressed":y&&m===x1?!0:void 0,"aria-roledescription":b,"aria-describedby":d.draggable}),[r,m,x,y,b,d.draggable]);return{active:u,activatorEvent:l,activeNodeRect:c,attributes:k,isDragging:y,listeners:r?void 0:T,node:v,over:f,setNodeRef:S,setActivatorNodeRef:N,transform:E}}function MY(){return g.useContext(fA)}const FY="Droppable",PY={timeout:25};function BY(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:s}=e;const i=Gu(FY),{active:o,dispatch:l,over:u,measureDroppableContainers:c}=g.useContext(uo),d=g.useRef({disabled:n}),p=g.useRef(!1),f=g.useRef(null),m=g.useRef(null),{disabled:b,updateMeasurementsFor:x,timeout:y}={...PY,...s},E=ji(x??r),v=g.useCallback(()=>{if(!p.current){p.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(E.current)?E.current:[E.current]),m.current=null},y)},[y]),S=Wu({callback:v,disabled:b||!o}),A=g.useCallback((k,F)=>{S&&(F&&(S.unobserve(F),p.current=!1),k&&S.observe(k))},[S]),[N,T]=Ml(A),w=ji(t);return g.useEffect(()=>{!S||!N.current||(S.disconnect(),p.current=!1,S.observe(N.current))},[N,S]),g.useEffect(()=>(l({type:Yt.RegisterDroppable,element:{id:r,key:i,disabled:n,node:N,rect:f,data:w}}),()=>l({type:Yt.UnregisterDroppable,key:i,id:r})),[r]),g.useEffect(()=>{n!==d.current.disabled&&(l({type:Yt.SetDroppableDisabled,id:r,key:i,disabled:n}),d.current.disabled=n)},[r,i,n,l]),{active:o,rect:f,isOver:u?.id===r,node:N,over:u,setNodeRef:T}}function UY(e){let{animation:t,children:n}=e;const[r,s]=g.useState(null),[i,o]=g.useState(null),l=Fl(n);return!n&&!r&&l&&s(l),Tr(()=>{if(!i)return;const u=r?.key,c=r?.props.id;if(u==null||c==null){s(null);return}Promise.resolve(t(c,i)).then(()=>{s(null)})},[t,r,i]),Ve.createElement(Ve.Fragment,null,n,r?g.cloneElement(r,{ref:o}):null)}const $Y={x:0,y:0,scaleX:1,scaleY:1};function zY(e){let{children:t}=e;return Ve.createElement(uo.Provider,{value:pA},Ve.createElement(qu.Provider,{value:$Y},t))}const HY={position:"fixed",touchAction:"none"},GY=e=>dx(e)?"transform 250ms ease":void 0,WY=g.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:s,children:i,className:o,rect:l,style:u,transform:c,transition:d=GY}=e;if(!l)return null;const p=s?c:{...c,scaleX:1,scaleY:1},f={...HY,width:l.width,height:l.height,top:l.top,left:l.left,transform:ua.Transform.toString(p),transformOrigin:s&&r?MV(r,l):void 0,transition:typeof d=="function"?d(r):d,...u};return Ve.createElement(n,{className:o,style:f,ref:t},i)}),qY=e=>t=>{let{active:n,dragOverlay:r}=t;const s={},{styles:i,className:o}=e;if(i!=null&&i.active)for(const[l,u]of Object.entries(i.active))u!==void 0&&(s[l]=n.node.style.getPropertyValue(l),n.node.style.setProperty(l,u));if(i!=null&&i.dragOverlay)for(const[l,u]of Object.entries(i.dragOverlay))u!==void 0&&r.node.style.setProperty(l,u);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(const[u,c]of Object.entries(s))n.node.style.setProperty(u,c);o!=null&&o.active&&n.node.classList.remove(o.active)}},VY=e=>{let{transform:{initial:t,final:n}}=e;return[{transform:ua.Transform.toString(t)},{transform:ua.Transform.toString(n)}]},YY={duration:250,easing:"ease",keyframes:VY,sideEffects:qY({styles:{active:{opacity:"0"}}})};function KY(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:s}=e;return Hu((i,o)=>{if(t===null)return;const l=n.get(i);if(!l)return;const u=l.node.current;if(!u)return;const c=dA(o);if(!c)return;const{transform:d}=Tn(o).getComputedStyle(o),p=tA(d);if(!p)return;const f=typeof t=="function"?t:ZY(t);return lA(u,s.draggable.measure),f({active:{id:i,data:l.data,node:u,rect:s.draggable.measure(u)},draggableNodes:n,dragOverlay:{node:o,rect:s.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:s,transform:p})})}function ZY(e){const{duration:t,easing:n,sideEffects:r,keyframes:s}={...YY,...e};return i=>{let{active:o,dragOverlay:l,transform:u,...c}=i;if(!t)return;const d={x:l.rect.left-o.rect.left,y:l.rect.top-o.rect.top},p={scaleX:u.scaleX!==1?o.rect.width*u.scaleX/l.rect.width:1,scaleY:u.scaleY!==1?o.rect.height*u.scaleY/l.rect.height:1},f={x:u.x-d.x,y:u.y-d.y,...p},m=s({...c,active:o,dragOverlay:l,transform:{initial:u,final:f}}),[b]=m,x=m[m.length-1];if(JSON.stringify(b)===JSON.stringify(x))return;const y=r?.({active:o,dragOverlay:l,...c}),E=l.node.animate(m,{duration:t,easing:n,fill:"forwards"});return new Promise(v=>{E.onfinish=()=>{y?.(),v()}})}}let y1=0;function XY(e){return g.useMemo(()=>{if(e!=null)return y1++,y1},[e])}const QY=Ve.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:s,transition:i,modifiers:o,wrapperElement:l="div",className:u,zIndex:c=999}=e;const{activatorEvent:d,active:p,activeNodeRect:f,containerNodeRect:m,draggableNodes:b,droppableContainers:x,dragOverlay:y,over:E,measuringConfiguration:v,scrollableAncestors:S,scrollableAncestorRects:A,windowRect:N}=MY(),T=g.useContext(qu),w=XY(p?.id),k=mA(o,{activatorEvent:d,active:p,activeNodeRect:f,containerNodeRect:m,draggingNodeRect:y.rect,over:E,overlayNodeRect:y.rect,scrollableAncestors:S,scrollableAncestorRects:A,transform:T,windowRect:N}),F=bx(f),C=KY({config:r,draggableNodes:b,droppableContainers:x,measuringConfiguration:v}),$=F?y.setRef:void 0;return Ve.createElement(zY,null,Ve.createElement(UY,{animation:C},p&&w?Ve.createElement(WY,{key:w,id:p.id,ref:$,as:l,activatorEvent:d,adjustScale:t,className:u,transition:i,rect:F,style:{zIndex:c,...s},transform:k},n):null))}),JY=6e4,eK=10080*60*1e3,tK={P1:"error",P2:"warning",P3:"neutral"},nK={backlog:"bg-spur-text-faint",todo:"bg-spur-info",wip:"bg-spur-warning",testing:"bg-spur-accent",done:"bg-spur-success",blocked:"bg-spur-error",cancelled:"bg-spur-text-faint"};function rK(e,t){const n=new Date(e).getTime(),r=t-n,s=Math.floor(r/1e3);if(s<60)return"just now";const i=Math.floor(s/60);if(i<60)return`${i}m ago`;const o=Math.floor(i/60);if(o<24)return`${o}h ago`;const l=Math.floor(o/24);return l<30?`${l}d ago`:`${Math.floor(l/30)}mo ago`}function hA({task:e,onClick:t}){const{attributes:n,listeners:r,setNodeRef:s,transform:i,isDragging:o}=jY({id:e.wbs,data:{task:e}}),[l,u]=g.useState(Date.now());g.useEffect(()=>{const m=setInterval(()=>u(Date.now()),JY);return()=>clearInterval(m)},[]);const c=i?{transform:ua.Transform.toString(i),zIndex:o?50:void 0}:void 0,{subtaskProgress:d}=ex(),p=d.get(e.wbs),f=e.updatedAt?l-new Date(e.updatedAt).getTime()>eK:!1;return a.jsx(v7,{variant:"compact",asChild:!0,className:`group bg-spur-surface-2 hover:bg-spur-surface-3 rounded-xl border border-spur-border hover:border-spur-accent/60 shadow-xs hover:shadow-md cursor-pointer transition-all duration-150 w-full text-left ${o?"opacity-30":""}`,children:a.jsx("button",{ref:s,type:"button",style:c,onClick:()=>t(e.wbs),...r,...n,"aria-roledescription":"draggable card",children:a.jsxs(A7,{className:"p-3 gap-1.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-mono font-semibold text-spur-text",children:[a.jsx("span",{className:`h-2 w-2 rounded-full shrink-0 ring-1 ring-spur-surface-2 ${nK[e.status]??"bg-spur-text-faint"}`,"data-status":e.status,"aria-hidden":"true"}),e.wbs]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[e.estimateHours!==void 0&&a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted flex items-center gap-0.5",title:`Estimated: ${e.estimateHours}h`,children:[a.jsx("span",{className:"text-spur-text-faint text-[9px]",children:"⏱"}),e.estimateHours,"h"]}),e.priority&&a.jsx(Lt,{variant:tK[e.priority]??"outline",size:"xs",className:"font-mono text-[10px] font-semibold",children:e.priority})]})]}),a.jsx("p",{className:"text-sm font-medium text-spur-text leading-snug line-clamp-2 group-hover:text-spur-accent transition-colors",children:e.name}),a.jsxs("div",{className:"flex gap-1.5 flex-wrap items-center pt-0.5",children:[p&&p.total>0&&a.jsxs("div",{className:"flex items-center gap-1.5 min-w-[3.5rem]","data-testid":"subtask-progress",title:"subtasks done/total",children:[a.jsx("div",{className:"h-1 flex-1 rounded-full bg-spur-border/60 overflow-hidden",children:a.jsx("div",{className:"h-full bg-spur-success",style:{width:`${Math.round(p.done/p.total*100)}%`}})}),a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted shrink-0",children:[p.done,"/",p.total]})]}),e.type&&e.type!=="task"&&a.jsx(Lt,{variant:"outline",size:"xs",className:"text-[10px] font-mono border-spur-border text-spur-text-muted",children:e.type}),e.template&&e.template!=="feature-impl"&&a.jsx(Lt,{variant:"outline",size:"xs",className:"text-[10px] font-mono border-spur-accent/40 text-spur-accent bg-spur-accent/5 font-medium",children:e.template}),e.featureId&&a.jsx(Lt,{variant:"outline",size:"xs",className:"text-[10px] font-mono border-spur-border text-spur-text-muted",children:e.featureId}),e.dependencyCount!==void 0&&e.dependencyCount>0&&a.jsxs("span",{className:"text-[10px] font-mono text-spur-text-muted flex items-center gap-0.5",title:`${e.dependencyCount} dependenc${e.dependencyCount===1?"y":"ies"}`,children:[a.jsx("span",{className:"text-spur-text-faint text-[9px]",children:"⛓"}),e.dependencyCount]}),e.updatedAt&&a.jsx("span",{className:`text-xs font-mono ml-auto ${f?"text-spur-text-faint":"text-spur-text-muted"}`,title:e.updatedAt,children:rK(e.updatedAt,l)})]})]})})})}function sK({status:e,label:t,tasks:n,onCardClick:r,sortDir:s,onSortToggle:i}){const{setNodeRef:o,isOver:l}=BY({id:e,data:{status:e}});return a.jsxs("section",{ref:o,"aria-label":`${t} column`,className:`flex flex-col flex-1 min-w-[16rem] rounded-xl border transition-colors duration-200 overflow-hidden ${l?"bg-spur-surface/40 border-spur-accent shadow-lg ring-1 ring-spur-accent/30":"bg-transparent border-spur-border"}`,children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2.5 border-b border-spur-border shrink-0 bg-spur-surface",children:[a.jsxs("span",{className:"text-xs font-semibold text-spur-text uppercase tracking-wide",children:[yp(e)," ",t]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(Lt,{variant:"ghost",size:"sm",className:"font-mono text-spur-text-muted bg-spur-surface-2 border border-spur-border/80 px-2 py-0.5",children:n.length}),i&&a.jsx(Fe,{variant:"ghost",size:"xs",className:"h-6 w-6 p-0 flex items-center justify-center text-spur-text-muted hover:text-spur-text hover:bg-spur-surface-2 rounded-md transition-colors",onClick:i,"aria-label":`Sort ${t} by WBS`,title:`Sort ${t}: ${s==="asc"?"WBS ↓":s==="desc"?"WBS ↑":"none"}`,children:s==="asc"?"↓":s==="desc"?"↑":"⇅"})]})]}),a.jsxs("div",{className:"flex-1 overflow-y-auto p-2 space-y-2 min-h-[4rem]",children:[n.map(u=>a.jsx(hA,{task:u,onClick:r},u.wbs)),n.length===0&&a.jsx("div",{className:"flex items-center justify-center h-20 text-xs text-spur-text-muted italic border border-dashed border-spur-border/60 rounded-lg my-1 bg-spur-surface/30",children:"No tasks"})]})]})}const aK=g.lazy(()=>Zw(()=>import("./TaskDetail.CK7oXddP.js"),__vite__mapDeps([2,3,1,4,5]))),iK=Fn,gA="docs/tasks",E1="spur:detail-width",oK=new Set(["blocked","cancelled"]);function lK(e,t){return t?e.filter(n=>!(t.status!==void 0&&!t.status.split(",").includes(n.status)||t.featureId&&!n.featureId?.toLowerCase().includes(t.featureId.toLowerCase())||t.parentWbs&&n.parentWbs!==t.parentWbs)):e}function bA(e){const{onSelectTask:t,filters:n,folder:r,hiddenColumns:s,onConnectionChange:i,onSyncChange:o}=e,[l,u]=g.useState({}),[c,d]=g.useState(gA),[p,f]=g.useState(null),[m,b]=g.useState(()=>{const Z=typeof window<"u"?Math.min(1728,window.innerWidth*.8):1728;if(typeof window>"u")return Z;try{const ie=Number.parseFloat(window.localStorage.getItem(E1)??"");if(Number.isFinite(ie)&&ie>0)return Math.min(ie,window.innerWidth*.8)}catch{}return Z}),x=r??c,y=s??oK,E=g.useCallback(()=>Pt.task.list({folder:x}),[x]),{tasks:v,loading:S,error:A,connected:N,lastSyncAt:T,setTasks:w,store:k}=ex(E),[F,C]=g.useState(null);g.useEffect(()=>{i?.(N)},[N,i]),g.useEffect(()=>{o?.(T)},[T,o]),g.useEffect(()=>{typeof Pt.task.folders=="function"&&Pt.task.folders({}).then(Z=>{const{data:ie,activeFolder:L}=Z,Ee=L??ie?.[0]?.path;Ee!==void 0&&d(Ee)}).catch(()=>{})},[]),g.useEffect(()=>{document.documentElement.style.setProperty("--detail-w",`${m}px`)},[m]),g.useEffect(()=>{if(!p)return;const Z=ie=>{ie.key==="Escape"&&f(null)};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[p]);const $=Pi();g.useEffect(()=>{const Z=$.pathname.split("/"),ie=Z.indexOf("tasks"),L=ie>=0?Z[ie+1]:void 0;L&&/^\d{4}$/.test(L)&&f(L)},[$.pathname]);const z=l1(gx,{activationConstraint:{distance:5}}),M=l1(mx),G=jV(z,M),H=lK(v,n),j=Z=>{u(ie=>{const L={...ie};return ie[Z]==="asc"?L[Z]="desc":ie[Z]==="desc"?delete L[Z]:L[Z]="asc",L})},q=Z=>{const ie=H.filter(Ee=>Ee.status===Z),L=l[Z]??"desc";return[...ie].sort((Ee,fe)=>{const Y=Ee.wbs.localeCompare(fe.wbs);return L==="asc"?Y:-Y})},re=Z=>v.find(ie=>ie.wbs===Z),pe=Z=>{C(String(Z.active.id))},I=Z=>{C(null);const{active:ie,over:L}=Z;if(!L)return;const Ee=String(ie.id),fe=String(L.id),Y=re(Ee);if(!Y||Y.status===fe)return;const me=[...v];w(te=>te.map(O=>O.wbs===Ee?{...O,status:fe}:O)),Pt.task.transition({wbs:Ee,toStatus:fe}).catch(te=>{w(me);const O=te instanceof Error?te.message:"Transition failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:O}}))})};return S?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsx(Ss,{size:"lg",className:"text-spur-accent"})}):A?a.jsx("div",{className:"flex items-center justify-center h-full",children:a.jsxs("div",{className:"text-center text-spur-text-muted",children:[a.jsx("p",{className:"text-lg font-semibold",children:"Failed to load tasks"}),a.jsx("p",{className:"text-sm",children:A.message})]})}):a.jsx(sv.Provider,{value:k,children:a.jsxs(DY,{sensors:G,onDragStart:pe,onDragEnd:I,children:[a.jsxs("div",{className:"flex flex-col h-full",children:[a.jsx("div",{className:"flex gap-3 overflow-x-auto h-full p-4",children:iK.filter(Z=>!y.has(Z)).map(Z=>a.jsx(sK,{status:Z,label:Z,tasks:q(Z),onCardClick:ie=>{f(ie),t(ie)},sortDir:l[Z],onSortToggle:()=>j(Z)},Z))}),p&&a.jsxs(a.Fragment,{children:[a.jsx("button",{type:"button","aria-label":"Close task detail",className:"fixed inset-0 z-50 bg-black/40 border-0 p-0 cursor-default",onClick:()=>f(null)}),a.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Task detail",className:"fixed top-0 right-0 h-full z-50 bg-spur-surface border-l border-spur-border shadow-2xl flex",style:{width:"var(--detail-w)",minWidth:"36rem",maxWidth:"80vw"},children:[a.jsx(Li,{targetVar:"--detail-w",onResizeEnd:Z=>{const ie=Math.max(576,Math.min(Z,window.innerWidth*.8));b(ie);try{window.localStorage.setItem(E1,String(ie))}catch{}},direction:"horizontal",invert:!0}),a.jsx("div",{className:"flex flex-col flex-1 overflow-hidden",children:a.jsx("div",{className:"flex-1 overflow-y-auto","data-testid":"detail-body",children:(()=>{const Z=v.find(ie=>ie.wbs===p);return Z?a.jsx(g.Suspense,{fallback:a.jsx("div",{className:"flex items-center justify-center h-32 text-spur-text-muted text-sm",children:"Loading detail..."}),children:a.jsx(aK,{task:Z,onClose:()=>f(null),onTransition:(ie,L)=>{w(Ee=>Ee.map(fe=>fe.wbs===ie?{...fe,status:L}:fe)),Pt.task.transition({wbs:ie,toStatus:L}).catch(Ee=>{const fe=Ee instanceof Error?Ee.message:"Transition failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:fe}}))})}})}):null})()})})]})]})]}),a.jsx(QY,{dropAnimation:null,children:F?(()=>{const Z=re(F);return Z?a.jsx("div",{className:"opacity-90",children:a.jsx(hA,{task:Z,onClick:()=>{}})}):null})():null})]})})}const id=[{id:"kanban",label:"Kanban",component:bA}];function xA(){const[e,t]=ap(),n=Pi(),r=ip(),s=g.useMemo(()=>{const u=n.pathname.split("/"),c=u.indexOf("tasks"),d=c>=0?u[c+1]:void 0;return d&&/^\d{4}$/.test(d)?d:e.get("selected")},[n.pathname,e]),i=g.useMemo(()=>{const u={},c=e.get("status"),d=e.get("feature"),p=e.get("parent"),f=e.get("assignee"),m=e.get("folder");return c!==null&&(u.status=c),d&&(u.featureId=d),p&&(u.parentWbs=p),f&&(u.assignee=f),m&&(u.folder=m),u},[e]);return{selected:s,filters:i,selectTask:u=>{const c=new URLSearchParams(e);c.delete("selected");const d=c.toString(),p=u?`/board/tasks/${u}`:"/board/tasks";r(`${p}${d?`?${d}`:""}`,{replace:!0})},setFilter:(u,c)=>{t(d=>{const p=new URLSearchParams(d);return u==="feature"&&p.delete("parent"),u==="parent"&&p.delete("feature"),c!==null?p.set(u,c):p.delete(u),p},{replace:!0})}}}function uK(e){const t=e.trim();return/^\d{4}$/.test(t)?{kind:"navigate",wbs:t}:t.includes(".")?{kind:"filter",key:"parent",value:t}:{kind:"filter",key:"feature",value:t}}function cK(){const{selectTask:e,setFilter:t,filters:n}=xA(),[r,s]=g.useState(gA),[i,o]=g.useState([]),[l,u]=g.useState("kanban"),[c,d]=g.useState(!1),[p,f]=g.useState(""),[m,b]=g.useState(!1),[x,y]=g.useState(void 0),E=n.folder??r,v=new Set(n.status===void 0?Fn.filter(w=>w!=="blocked"&&w!=="cancelled"):n.status.split(",").filter(w=>Fn.some(k=>k===w))),S=new Set(Fn.filter(w=>!v.has(w)));g.useEffect(()=>{f(n.featureId??n.parentWbs??"")},[n.featureId,n.parentWbs]),g.useEffect(()=>{typeof Pt.task.folders=="function"&&Pt.task.folders({}).then(w=>{const{data:k,activeFolder:F}=w,C=F??k?.[0]?.path;k&&o(k),C!==void 0&&s(C)}).catch(()=>{})},[]);const A=w=>{const k=new Set(v);k.has(w)?k.delete(w):k.add(w),t("status",Fn.filter(F=>k.has(F)).join(","))},N=w=>{w.preventDefault();const k=uK(p);if(k.kind==="navigate"){e(k.wbs),f("");return}t(k.key,k.value||null)},T=(id.find(w=>w.id===l)??id[0]).component;return a.jsxs("div",{className:"task-kanban flex flex-col h-full",children:[a.jsx("header",{className:"mx-auto w-full max-w-[1600px] shrink-0 px-4 pt-3",children:a.jsxs("div",{className:"flex flex-nowrap items-center justify-between gap-4 border-b border-spur-border pb-3",children:[a.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[a.jsx("span",{className:"text-2xl","aria-hidden":"true",children:"📋"}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("h1",{className:"text-xl font-bold tracking-tight text-spur-text",children:"Tasks"}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-spur-border bg-spur-surface-2 px-2.5 py-0.5 text-xs text-spur-text-muted font-mono",role:"status","data-testid":"tasks-live-chip",children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${m?"bg-spur-success":"bg-spur-error"}`,"aria-hidden":"true"}),"last sync ",x?new Date(x).toLocaleString():"—"]})]}),a.jsx("p",{className:"text-xs text-spur-text-muted mt-0.5",children:"Task corpus, kanban lanes, and phase filters"})]})]}),a.jsxs("div",{className:"flex min-w-0 flex-nowrap items-center gap-2.5 overflow-x-auto",children:[a.jsx(ci,{variant:"ghost",size:"xs",className:"text-xs shrink-0 w-44 bg-spur-surface-2 border border-spur-border rounded-lg text-spur-text",value:E,onChange:w=>t("folder",w.target.value),"aria-label":"Task phase folder",children:i.map(w=>a.jsx("option",{value:w.path,children:w.label?`${w.label} (${w.path})`:w.path},w.path))}),a.jsx("div",{className:"flex shrink-0 items-center gap-1 bg-spur-surface-2 border border-spur-border px-2 py-1 rounded-xl",children:Fn.map(w=>a.jsxs("label",{htmlFor:`tasks-status-${w}`,className:"flex items-center gap-1.5 px-1.5 py-0.5 rounded-md hover:bg-spur-surface-3 transition-colors cursor-pointer",children:[a.jsx(Mb,{id:`tasks-status-${w}`,size:"xs",checked:!S.has(w),onChange:()=>A(w)}),a.jsxs("span",{className:"text-[11px] font-medium text-spur-text-muted select-none",children:[yp(w)," ",w]})]},w))}),a.jsx("form",{onSubmit:N,className:"flex shrink-0 items-center",children:a.jsx(Ii,{"aria-label":"Filter by WBS or feature",type:"text",placeholder:"WBS or feature",variant:"bordered",size:"xs",className:"w-36 bg-spur-surface-2 border-spur-border text-spur-text",value:p,onChange:w=>f(w.target.value)})}),a.jsx(Fe,{variant:"primary",size:"sm",className:"shrink-0 font-medium",onClick:()=>d(!0),children:"+ New Task"}),a.jsx("div",{className:"flex shrink-0 items-center gap-1 bg-spur-surface-2 border border-spur-border p-1 rounded-xl",children:id.map(w=>a.jsx("button",{type:"button",className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition-all ${l===w.id?"bg-primary text-primary-content font-bold shadow-sm":"text-spur-text-muted hover:text-spur-text hover:bg-spur-surface-3"}`,onClick:()=>u(w.id),children:w.label},w.id))})]})]})}),a.jsx("div",{"data-kanban-board":!0,className:"flex-1 overflow-hidden",children:a.jsx(T,{onSelectTask:e,filters:n,folder:E,hiddenColumns:S,onConnectionChange:b,onSyncChange:y})}),a.jsx(nv,{open:c,onClose:()=>d(!1),onCreated:()=>{},folder:E})]})}function dK(e,t){Pt.task.transition({wbs:e,toStatus:t}).catch(n=>{const r=n instanceof Error?n.message:"Transition failed";typeof window<"u"&&window.dispatchEvent(new CustomEvent("api-error",{detail:{message:r}}))})}function pK(){const{filters:e,selectTask:t}=xA();return a.jsx("div",{className:"task-kanban flex flex-col h-full",children:a.jsx("div",{"data-kanban-board":!0,className:"flex-1 overflow-hidden",children:a.jsx(bA,{onSelectTask:t,filters:e})})})}const fK={id:"tasks",name:"Tasks",icon:"📋",route:"tasks",component:cK,sidebarLabel:"Tasks",description:"Task kanban, lifecycle status, and per-task detail",order:40},mK=Object.freeze(Object.defineProperty({__proto__:null,TaskKanbanView:pK,module:fK,transition:dK},Symbol.toStringTag,{value:"Module"}));function yA(e){return e===null||typeof e!="object"?null:"module"in e&&S1(e.module)?e.module:"default"in e&&S1(e.default)?e.default:null}function S1(e){return e===null||typeof e!="object"?!1:"id"in e&&typeof e.id=="string"&&"name"in e&&typeof e.name=="string"&&"icon"in e&&typeof e.icon=="string"&&"route"in e&&typeof e.route=="string"&&"component"in e&&typeof e.component=="function"}function EA(e,t){const n=typeof e.order=="number",r=typeof t.order=="number";return n&&r?e.order-t.order:n?-1:r?1:0}function hK(e){const t=[],n=e("./*/index.{ts,tsx}",{eager:!0});for(const r of Object.values(n)){const s=yA(r);s&&t.push(s)}return t.sort((r,s)=>r.id.localeCompare(s.id)),t.sort(EA),t}function gK(){try{return hK(()=>Object.assign({"./designs/index.tsx":YH,"./features/index.tsx":wG,"./history/index.tsx":sW,"./observability/index.tsx":JW,"./plans/index.tsx":uq,"./projects/index.tsx":Bq,"./settings/index.tsx":SV,"./task-kanban/index.tsx":mK}))}catch(s){if(typeof require!="function")throw s}const e=require("node:fs"),t=require("node:path"),n=require("node:url"),r=typeof __dirname<"u"?__dirname:t.dirname(n.fileURLToPath(import.meta.url));return bK(r,{readdirSync:(s,i)=>e.readdirSync(s,i),tryRequire:s=>require(s)})}function bK(e,t){const n=require("node:path"),r=[];let s=[];try{s=t.readdirSync(e,{withFileTypes:!0})}catch{return r}const i=s.filter(o=>o.isDirectory()).map(o=>o.name).sort((o,l)=>o.localeCompare(l));for(const o of i)for(const l of["tsx","ts"]){const u=n.join(e,o,`index.${l}`);try{const c=t.tryRequire(u),d=yA(c);if(d){r.push(d);break}}catch{}}return r.sort(EA),r}function SA(e,t){const n=new Set(t?.disabled??[]),r=e.slice(),s=new Set(n);function i(){return r.filter(o=>!s.has(o.id))}return xK(r),{get modules(){return i()},getModule(o){return i().find(l=>l.id===o)},get defaultModule(){return i()[0]},disableModule(o){s.add(o)},enableModule(o){s.delete(o)},getEnabledModules(){return i().map(o=>o.id)},registerModuleRoot(o){}}}function xK(e){const t=new Map,n=new Map;for(const r of e){const s=t.get(r.id);if(s!==void 0)throw new Error(`Duplicate module id "${r.id}" discovered in two sources: ${s} and ${Ko(r)}`);t.set(r.id,Ko(r));const i=n.get(r.route);if(i!==void 0)throw new Error(`Duplicate module route "${r.route}" discovered in two sources: ${i} and ${Ko(r)}`);n.set(r.route,Ko(r))}}function Ko(e){return e.id}const xx=SA(gK(),{disabled:pL}),Fi=xx;xx.modules;xx.defaultModule;const TA=g.createContext({registry:Fi,hostDiagnostics:[]});function yK({value:e,children:t}){return a.jsx(TA.Provider,{value:e,children:t})}function NA(){return g.useContext(TA)}const sp="spur-board-layout-v3",T1="spur-board-layout-v2",N1="spur-board-layout",nr={version:3,sidebarWidth:240,rightPanelWidth:320,sidebarCollapsed:!0,rightPanelCollapsed:!0};function EK(){try{const e=localStorage.getItem(sp);if(e){const s=JSON.parse(e);return{version:3,sidebarWidth:typeof s.sidebarWidth=="number"?s.sidebarWidth:nr.sidebarWidth,rightPanelWidth:typeof s.rightPanelWidth=="number"?s.rightPanelWidth:nr.rightPanelWidth,sidebarCollapsed:typeof s.sidebarCollapsed=="boolean"?s.sidebarCollapsed:nr.sidebarCollapsed,rightPanelCollapsed:typeof s.rightPanelCollapsed=="boolean"?s.rightPanelCollapsed:nr.rightPanelCollapsed}}const t=localStorage.getItem(T1),n=localStorage.getItem(N1),r=t||n;if(r){const s=JSON.parse(r),i={version:3,sidebarWidth:typeof s.sidebarWidth=="number"?s.sidebarWidth:nr.sidebarWidth,rightPanelWidth:typeof s.rightPanelWidth=="number"?s.rightPanelWidth:nr.rightPanelWidth,sidebarCollapsed:nr.sidebarCollapsed,rightPanelCollapsed:typeof s.rightPanelCollapsed=="boolean"?s.rightPanelCollapsed:nr.rightPanelCollapsed};try{localStorage.setItem(sp,JSON.stringify(i)),localStorage.removeItem(T1),localStorage.removeItem(N1)}catch{}return i}return{...nr}}catch{return{...nr}}}function SK(e){try{localStorage.setItem(sp,JSON.stringify({...e,version:3}))}catch{}}const wA="spur.board.projects.draft.v1";function qs(e){return{path:e,text:"",refs:[],revision:0}}function TK(e){if(e===null||typeof e!="object")return!1;const t=e;return t.kind==="task"?typeof t.wbs=="string"&&t.wbs.length>0:t.kind==="feature"?typeof t.id=="string"&&t.id.length>0:!1}function NK(e){if(e===null||typeof e!="object"||Array.isArray(e))return null;const t=e;return typeof t.path!="string"||typeof t.text!="string"||typeof t.revision!="number"||!Number.isFinite(t.revision)||!Array.isArray(t.refs)||!t.refs.every(n=>TK(n))?null:{...t,path:t.path,text:t.text,refs:t.refs,revision:t.revision}}function wK(e){try{const t=globalThis.localStorage?.getItem(wA);if(t==null)return qs(e);const n=NK(JSON.parse(t));return n===null||n.path!==e?(js(qs(e)),qs(e)):n}catch{return qs(e)}}function js(e){try{globalThis.localStorage?.setItem(wA,JSON.stringify(e))}catch{}}const vK={draft:qs(""),setText:()=>{},addRef:()=>{},removeRef:()=>{},persistPending:()=>{},clearSubmitted:()=>{}},vA=g.createContext(vK);function AK(){return g.useContext(vA)}function kK({children:e}){const n=_a().path,[r,s]=g.useState(()=>qs(""));g.useEffect(()=>{n!==null&&s(wK(n))},[n]);const i=g.useMemo(()=>({draft:r,setText:o=>s(l=>{if(l.path==="")return l;const u={...l,text:o,revision:l.revision+1};return js(u),u}),addRef:o=>s(l=>{if(l.path===""||l.refs.some(c=>Xc(c,o)))return l;const u={...l,refs:[...l.refs,o],revision:l.revision+1};return js(u),u}),removeRef:o=>s(l=>{if(l.path===""||!l.refs.some(c=>Xc(c,o)))return l;const u={...l,refs:l.refs.filter(c=>!Xc(c,o)),revision:l.revision+1};return js(u),u}),persistPending:o=>s(l=>{if(l.path==="")return l;const u={...l,pending:{requestKey:o,revision:l.revision}};return js(u),u}),clearSubmitted:o=>s(l=>{if(l.path===""||l.revision!==o)return l;const u={path:l.path,text:"",refs:[],revision:l.revision+1};return js(u),u})}),[r]);return a.jsx(vA.Provider,{value:i,children:e})}function _K(){const[e,t]=g.useState([]);return g.useEffect(()=>{if(typeof window>"u")return;const n=r=>{const i=r.detail?.message||"An error occurred",o=`${Date.now()}-${Math.random().toString(36).slice(2,7)}`;t(l=>[...l,{id:o,message:i}]),setTimeout(()=>{t(l=>l.filter(u=>u.id!==o))},5e3)};return window.addEventListener("api-error",n),()=>{window.removeEventListener("api-error",n)}},[]),e.length===0?null:a.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-md w-full px-4 pointer-events-none",children:e.map(n=>a.jsxs("div",{className:"pointer-events-auto flex items-center justify-between gap-3 p-3 bg-red-950/90 border border-red-500/40 text-red-200 text-sm rounded-md shadow-lg backdrop-blur",role:"alert",children:[a.jsx("span",{className:"flex-1 break-words",children:n.message}),a.jsx("button",{type:"button",className:"text-red-400 hover:text-red-100 text-base font-bold leading-none px-1",onClick:()=>t(r=>r.filter(s=>s.id!==n.id)),"aria-label":"Close error toast",children:"×"})]},n.id))})}const CK="Enter",IK=229;function RK(e){return e.key===CK&&!e.shiftKey&&!e.nativeEvent.isComposing&&e.nativeEvent.keyCode!==IK}const DK=[{name:"/review",description:"Inspect staged git diff, verify test coverage & lint",category:"git",argumentHint:"[target] [--cached]",tags:["builtin","git","review"]},{name:"/commit",description:"Draft conventional commit message from staged hunks",category:"git",argumentHint:"[--all] [-m <message>]",tags:["builtin","git","commit"]},{name:"/compact",description:"Purge execution trace and condense context window",category:"sys",argumentHint:"[focus]",tags:["builtin","sys","compact"]},{name:"/revert",description:"Undo last agent file changes or restore git stash",category:"git",argumentHint:"[stash-id | file]",tags:["builtin","git","revert"]},{name:"/resume",description:"Resume paused background agent run",category:"dev",argumentHint:"[run-id]",tags:["builtin","dev","resume"]},{name:"/terminal",description:"Run isolated bash execution in sandbox mirror",category:"sys",argumentHint:"[command]",tags:["builtin","sys","terminal"]},{name:"/cost",description:"Inspect token breakdown and USD expenditure",category:"sys",tags:["builtin","sys","cost"]},{name:"/sp:dev-plan",description:"Plan a feature from description (intake → AC → tasks)",category:"harness",argumentHint:'"<description>" [--feature <id>]',tags:["sp","dev","plan"]},{name:"/sp:dev-run",description:"Drive one task end-to-end through verification pipeline",category:"harness",argumentHint:"<wbs> [--mode <full|implement>]",tags:["sp","dev","run"]},{name:"/sp:dev-verify",description:"Verify a task against requirements and acceptance criteria",category:"harness",argumentHint:"<wbs> [--bdd] [--auto]",tags:["sp","dev","verify"]}],OK=[{id:"auto",label:"auto",desc:"Orchestrator auto-dispatch (default)"},{id:"coder",label:"coder",desc:"Implementation & refactoring specialist"},{id:"reviewer",label:"reviewer",desc:"Verification, lint & SECUA reviewer"},{id:"planner",label:"planner",desc:"Architecture & decomposition specialist"}];function LK(e){if(!e)return!0;const{state:t,instanceId:n}=e.orchestrator;return t==="missing"||t==="unresolvable"||!n}function jK({activeModule:e}){const[t,n]=g.useState(!1),[r,s]=g.useState(!1),[i,o]=g.useState(null),[l,u]=g.useState("auto"),[c,d]=g.useState(!1),[p,f]=g.useState(!1),[m,b]=g.useState(0),[x,y]=g.useState("all"),[E,v]=g.useState(DK),S=g.useMemo(()=>{const O=new Map;for(const ye of E){if(Array.isArray(ye.tags)){for(const we of ye.tags)if(we&&typeof we=="string"){const Pe=we.trim().toLowerCase();O.set(Pe,(O.get(Pe)??0)+1)}}if(ye.category){const we=ye.category.trim().toLowerCase();O.set(we,(O.get(we)??0)+1)}}const he=["sp","cc","kk","wt","git","dev","sys","harness","builtin"];return["all",...Array.from(O.keys()).sort((ye,we)=>{const Pe=he.indexOf(ye),ue=he.indexOf(we);if(Pe!==-1&&ue!==-1)return Pe-ue;if(Pe!==-1)return-1;if(ue!==-1)return 1;const Ye=(O.get(we)??0)-(O.get(ye)??0);return Ye!==0?Ye:ye.localeCompare(we)})]},[E]),A=_a(),{draft:N,setText:T,persistPending:w,clearSubmitted:k}=AK(),F=A.fleet?.orchestrator?.instanceId,C=LK(A.fleet),{requests:$,failed:z}=Bv(F??null),M=i!==null?$.get(i)??null:null,G=Mv(M,A.fleet,r),H=jv[G],j=r||i!==null,q=j?`${H.label} — Next: ${H.action}`:"",re=g.useRef(null);g.useEffect(()=>{let O=!0;return(async()=>{try{const he=await Ge(new Request(`${nt()}/agent/commands`));if(he.ok){const be=await he.json();O&&Array.isArray(be.commands)&&be.commands.length>0&&v(be.commands)}}catch{}})(),()=>{O=!1}},[]),g.useEffect(()=>{if(!c)return;const O=he=>{re.current&&!re.current.contains(he.target)&&d(!1)};return document.addEventListener("click",O),()=>document.removeEventListener("click",O)},[c]),g.useEffect(()=>{N.text.startsWith("/")&&f(!1)},[N.text]);const pe=N.text.trim().toLowerCase(),I=pe.startsWith("/")&&!p,Z=I?E.filter(O=>{const he=x==="all"||Array.isArray(O.tags)&&O.tags.map(we=>we.toLowerCase()).includes(x)||O.category.toLowerCase()===x,be=pe.startsWith("/")?pe.slice(1):pe,ye=O.name.toLowerCase().startsWith(pe)||O.name.toLowerCase().includes(be)||!!O.argumentHint?.toLowerCase().includes(be)||O.description.toLowerCase().includes(be)||Array.isArray(O.tags)&&O.tags.some(we=>we.toLowerCase().includes(be));return he&&ye}):[],ie=I&&Z.length>0,L=O=>{T(`${O} `),f(!0),document.querySelector('[data-testid="agent-bar-input"]')?.focus()},Ee=O=>{const he=N.text,be=he.length>0&&!he.endsWith(" ")?`${he} ${O}`:`${he}${O}`;T(be),document.querySelector('[data-testid="agent-bar-input"]')?.focus()},fe=()=>l==="auto"?F:A.fleet?.members?.find(he=>he.role===l||he.instanceId===l)?.instanceId??F,Y=async()=>{const O=A.path,he=fe();if(O===null||he===void 0||r)return;const be=N.text;if(be.trim().length===0)return;const ye={text:be,refs:N.refs,revision:N.revision},we=N.pending!==void 0&&typeof N.pending.requestKey=="string"&&N.pending.requestKey.length>0&&N.pending.revision===N.revision?N.pending:void 0,Pe=we!==void 0?we.requestKey:crypto.randomUUID();w(Pe),s(!0),o(null),f(!0);try{const ue=await Ge(new Request(`${nt()}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({to:he,from:$u,body:cq(ye.text,ye.refs),requestKey:Pe,projectPath:O})}));if(!ue.ok)return;const at=(await ue.json().catch(()=>null))?.msgId;o(typeof at=="string"?at:null),k(ye.revision)}catch{}finally{s(!1)}};if(!t)return a.jsxs(a.Fragment,{children:[a.jsx("div",{role:"status","aria-live":"polite",className:"sr-only","data-agent-bar-live":!0,children:q}),a.jsx(Fe,{variant:"ghost",className:"fixed bottom-6 right-6 z-30 h-12 w-12 rounded-full backdrop-blur-md bg-base-100/80 border border-spur-border shadow-2xl text-xl text-spur-text",onClick:()=>n(!0),"aria-label":"Open agent prompt bar","aria-expanded":!1,"data-testid":"agent-bar-dock",children:"✨"})]});const me=A.fleet?.members&&A.fleet.members.length>0?[{id:"auto",label:"auto",desc:"Orchestrator auto-dispatch (default)"},...A.fleet.members.map(O=>({id:O.instanceId,label:O.role||O.instanceId,desc:`${O.executor}${O.model?` · ${O.model}`:""}`}))]:OK,te=N.text.trim().length===0||l==="auto"&&C;return a.jsxs("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-30 w-[calc(100vw-2rem)] max-w-[84rem] backdrop-blur-md bg-base-100/80 border border-spur-border shadow-2xl rounded-2xl p-2.5 flex flex-col gap-2 transition-colors","data-testid":"agent-bar",children:[a.jsx("div",{role:"status","aria-live":"polite",className:"sr-only","data-agent-bar-live":!0,children:q}),ie&&a.jsxs("div",{"data-testid":"agent-bar-palette",className:"w-full rounded-2xl bg-base-100/95 border border-spur-border shadow-2xl overflow-hidden flex flex-col backdrop-blur-2xl mb-1 transition-colors",children:[a.jsxs("div",{className:"flex items-center justify-between px-3.5 py-2 border-b border-spur-border bg-base-200/50 text-xs",children:[a.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[a.jsx("span",{className:"font-mono text-spur-accent font-semibold text-[13px]",children:"/"}),a.jsx("span",{className:"font-mono text-[12px] font-medium text-spur-text",children:"Commands"}),a.jsxs("span",{className:"text-[11px] font-mono text-spur-text-muted",children:[Z.length," available"]})]}),a.jsx("div",{className:"flex items-center gap-1 overflow-x-auto no-scrollbar max-w-[65%] py-0.5",role:"tablist",children:S.slice(0,10).map(O=>a.jsx("button",{type:"button",role:"tab","aria-selected":x===O,onClick:()=>y(O),className:`px-2 py-0.5 rounded text-[11px] font-mono transition-colors shrink-0 cursor-pointer ${x===O?"bg-spur-accent/15 text-spur-accent border border-spur-accent/30 font-medium":"text-spur-text-muted hover:text-spur-text hover:bg-base-200"}`,children:O==="all"?"All":O},O))})]}),a.jsx("div",{className:"flex flex-col py-1.5 px-2 max-h-[260px] overflow-y-auto",role:"listbox",children:Z.map((O,he)=>{const be=he===m;return a.jsxs("button",{type:"button",role:"option","aria-selected":be,onClick:()=>L(O.name),title:O.description,className:`flex items-center w-full text-left px-3 py-2 rounded-lg cursor-pointer transition-colors ${be?"bg-spur-surface text-spur-accent font-medium":"hover:bg-base-200 text-spur-text-muted hover:text-spur-text"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 font-mono text-[13px] min-w-0 truncate flex-1",children:[a.jsx("span",{className:be?"font-semibold text-spur-accent":"font-medium text-spur-text",children:O.name}),O.argumentHint?a.jsx("span",{className:`font-mono text-xs truncate ${be?"text-spur-text/80":"text-spur-text-muted"}`,children:O.argumentHint}):a.jsx("span",{className:`font-sans text-xs italic truncate ${be?"text-spur-text/60":"text-spur-text-muted/60"}`,children:O.description})]}),a.jsx("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:(O.tags&&O.tags.length>0?O.tags.slice(0,2):[O.category]).map(ye=>a.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-base-200 text-spur-text-muted border border-spur-border",children:ye},ye))})]},O.name)})}),a.jsxs("div",{"data-testid":"agent-bar-hints",className:"flex items-center justify-between px-4 py-2 border-t border-spur-border bg-base-200/70 font-mono text-[11px] text-spur-text-muted select-none",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"↑↓"}),a.jsx("span",{children:"navigate"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"Tab"}),a.jsx("span",{children:"complete"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"↵"}),a.jsx("span",{children:"execute"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("span",{className:"flex items-center gap-1.5",children:[a.jsx("kbd",{className:"px-1.5 py-0.5 rounded bg-base-100 border border-spur-border text-spur-text font-semibold text-[10px] shadow-sm",children:"ESC"}),a.jsx("span",{children:"dismiss"})]})]}),a.jsxs("div",{className:"flex items-center gap-3 font-mono text-[11px]",children:[a.jsxs("button",{type:"button",onClick:()=>Ee("@"),className:"text-spur-text-muted hover:text-spur-accent cursor-pointer transition-colors flex items-center gap-0.5 group",title:"Reference files",children:[a.jsx("span",{className:"font-semibold text-spur-accent group-hover:underline",children:"@"}),a.jsx("span",{className:"group-hover:text-spur-text",children:"files"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("button",{type:"button",onClick:()=>Ee("#"),className:"text-spur-text-muted hover:text-spur-accent cursor-pointer transition-colors flex items-center gap-0.5 group",title:"Reference tasks and context",children:[a.jsx("span",{className:"font-semibold text-spur-accent group-hover:underline",children:"#"}),a.jsx("span",{className:"group-hover:text-spur-text",children:"context"})]}),a.jsx("span",{className:"text-spur-border",children:"•"}),a.jsxs("button",{type:"button",onClick:()=>Ee("!"),className:"text-spur-text-muted hover:text-spur-accent cursor-pointer transition-colors flex items-center gap-0.5 group",title:"Execute shell directly",children:[a.jsx("span",{className:"font-semibold text-spur-accent group-hover:underline",children:"!"}),a.jsx("span",{className:"group-hover:text-spur-text",children:"bash"})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-spur-text-muted font-mono text-sm select-none font-bold pl-1",children:">"}),a.jsxs("div",{className:"relative shrink-0",ref:re,children:[a.jsxs("button",{type:"button",onClick:()=>d(O=>!O),className:"flex items-center gap-1 px-2.5 py-1 rounded-lg bg-spur-surface hover:bg-base-200 border border-spur-border text-xs font-mono text-spur-accent transition-colors cursor-pointer group",title:"Target Agent Receiver (default: auto dispatch to orchestrator)","data-testid":"agent-bar-role-tag",children:[a.jsx("span",{className:"text-spur-text-muted font-sans text-[11px]",children:"to:"}),a.jsx("span",{className:"font-semibold",children:l}),a.jsx("span",{className:"text-spur-text-muted text-[10px] group-hover:text-spur-text transition-colors",children:"▾"})]}),c&&a.jsxs("div",{"data-testid":"agent-bar-role-menu",className:"absolute bottom-full left-0 mb-2 w-56 rounded-xl bg-base-100 border border-spur-border shadow-2xl p-1.5 z-50 flex flex-col gap-1 text-spur-text",children:[a.jsx("div",{className:"px-2.5 py-1 text-[10px] font-mono text-spur-text-muted uppercase tracking-wider",children:"Dispatch Target"}),me.map(O=>a.jsxs("button",{type:"button",onClick:()=>{u(O.label),d(!1)},className:`flex items-center justify-between px-2.5 py-1.5 rounded-lg text-left text-xs font-mono transition-colors ${l===O.label?"bg-spur-accent/15 text-spur-accent font-semibold":"hover:bg-base-200 text-spur-text-muted hover:text-spur-text"}`,children:[a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"font-medium text-spur-text",children:O.label}),a.jsx("span",{className:"text-[10px] text-spur-text-muted",children:O.desc})]}),l===O.label&&a.jsx("span",{className:"text-[12px]",children:"✓"})]},O.id))]})]}),a.jsx(B7,{variant:"ghost",rows:1,value:N.text,onChange:O=>T(O.target.value),onKeyDown:O=>{if(ie&&Z.length>0){if(O.key==="ArrowDown"){O.preventDefault(),b(he=>(he+1)%Z.length);return}if(O.key==="ArrowUp"){O.preventDefault(),b(he=>(he-1+Z.length)%Z.length);return}if(O.key==="Tab"){O.preventDefault();const he=Z[m];he&&L(he.name);return}if(O.key==="Escape"){O.preventDefault(),f(!0);return}}RK(O)&&(te||(O.preventDefault(),Y()))},placeholder:"Ask a coding agent to refine or implement, or type / for commands…","aria-label":"Agent prompt",className:"flex-1 min-h-9 resize-none bg-transparent text-spur-text placeholder:text-spur-text-muted border-0 focus:ring-0 focus:outline-none","data-testid":"agent-bar-input"}),a.jsx(Fe,{variant:"ghost",size:"sm",onClick:()=>n(!1),"aria-label":"Collapse agent prompt bar","aria-expanded":!0,className:"text-spur-text-muted hover:text-spur-text h-8 w-8 p-0 shrink-0",children:"▾"})]}),l==="auto"&&C&&a.jsx("div",{"data-testid":"agent-bar-orchestrator-missing",role:"status",className:"px-1 text-xs text-spur-text-muted",children:"Orchestrator unavailable — no orchestrator instance is bound to this project, so requests cannot be delivered yet."}),j&&a.jsxs("div",{"data-receipt-state":G,role:"status",className:`rounded-lg px-2.5 py-1 text-xs ${H.tone==="err"?"bg-spur-error/10 text-spur-error":H.tone==="warn"?"bg-spur-warning/10 text-spur-warning":"bg-spur-success/10 text-spur-success"}`,children:[a.jsx("span",{"aria-hidden":"true",className:"mr-1",children:H.icon}),a.jsx("span",{className:"font-medium",children:H.label}),a.jsxs("span",{className:"text-spur-text-muted",children:[" ","— ",H.meaning," Next: ",H.action,"."]}),z&&a.jsx("span",{className:"text-spur-text-muted",children:" (results feed unavailable)"})]})]})}function MK({name:e}){let t=0;for(let o=0;o<e.length;o++)t=(t<<5)-t+e.charCodeAt(o),t|=0;const n=Math.abs(t)%8,s=["text-emerald-400 bg-emerald-500/10 border-emerald-500/30","text-sky-400 bg-sky-500/10 border-sky-500/30","text-indigo-400 bg-indigo-500/10 border-indigo-500/30","text-amber-400 bg-amber-500/10 border-amber-500/30","text-rose-400 bg-rose-500/10 border-rose-500/30","text-purple-400 bg-purple-500/10 border-purple-500/30","text-teal-400 bg-teal-500/10 border-teal-500/30","text-cyan-400 bg-cyan-500/10 border-cyan-500/30"][n],i=()=>{switch(n){case 0:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M8 1.5l5.5 3.2v6.6L8 14.5l-5.5-3.2V4.7L8 1.5z"}),a.jsx("path",{d:"M8 1.5v13M2.5 4.7l5.5 3.3 5.5-3.3"})]});case 1:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"2",y:"2.5",width:"12",height:"11",rx:"2"}),a.jsx("path",{d:"M5 6l2.5 2L5 10M8.5 10H11"})]});case 2:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"4.5",cy:"4",r:"1.5"}),a.jsx("circle",{cx:"4.5",cy:"12",r:"1.5"}),a.jsx("circle",{cx:"11.5",cy:"7",r:"1.5"}),a.jsx("path",{d:"M4.5 5.5v5M4.5 7.5a4 4 0 004-1"})]});case 3:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M8 2l5.5 3-5.5 3-5.5-3L8 2z"}),a.jsx("path",{d:"M2.5 8l5.5 3 5.5-3M2.5 11l5.5 3 5.5-3"})]});case 4:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1.5"}),a.jsx("path",{d:"M6 1.5v2M10 1.5v2M6 12.5v2M10 12.5v2M1.5 6h2M1.5 10h2M12.5 6h2M12.5 10h2"})]});case 5:return a.jsx("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M5.5 4.5L2 8l3.5 3.5M10.5 4.5L14 8l-3.5 3.5M9 3l-2 10"})});case 6:return a.jsx("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M2 4a1.5 1.5 0 011.5-1.5h2.8a1.5 1.5 0 011.06.44l1.14 1.14c.28.28.66.42 1.06.42H12.5A1.5 1.5 0 0114 6v6a1.5 1.5 0 01-1.5 1.5h-9A1.5 1.5 0 012 12V4z"})});default:return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("circle",{cx:"8",cy:"8",r:"6"}),a.jsx("path",{d:"M2 8h12M8 2a9 9 0 010 12 9 9 0 010-12z"})]})}};return a.jsx("span",{"data-testid":"project-avatar-icon",className:`flex h-7 w-7 items-center justify-center rounded border ${s}`,children:i()})}function w1({currentName:e,collapsed:t=!1}){const[n,r]=g.useState(!1),[s,i]=g.useState([]),[o,l]=g.useState(null),[u,c]=g.useState(null),d=g.useRef(null);g.useEffect(()=>{if(!n)return;const m=new AbortController;return Ge(new Request(`${nt()}/projects`,{signal:m.signal})).then(async b=>{if(!b.ok)return;const x=await b.json();i(x.projects??[])}).catch(()=>{c("Failed to load projects")}),()=>m.abort()},[n]),g.useEffect(()=>{if(!n)return;const m=x=>{x.key==="Escape"&&r(!1)},b=x=>{d.current&&!d.current.contains(x.target)&&r(!1)};return document.addEventListener("keydown",m),document.addEventListener("mousedown",b),()=>{document.removeEventListener("keydown",m),document.removeEventListener("mousedown",b)}},[n]);const p=async m=>{if(m.current){r(!1);return}if(m.running&&m.port>0){window.location.href=`http://localhost:${m.port}/board`;return}l(m.name);try{const b=await Ge(new Request(`${nt()}/projects/start`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:m.name,path:m.path})}));if(!b.ok)throw new Error("Failed to start project");const x=await b.json();window.location.href=x.url||`http://localhost:${x.port}/board`}catch(b){c(b instanceof Error?b.message:"Start failed"),l(null)}},f=a.jsxs("button",{type:"button",onClick:()=>r(m=>!m),"aria-haspopup":"listbox","aria-expanded":n,"aria-label":`Switch project: ${e}`,title:e,"data-testid":"project-switcher-trigger",className:"group relative flex h-8 w-8 items-center justify-center rounded-md hover:bg-spur-accent/20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-spur-accent",children:[a.jsx("span",{className:`items-center justify-center ${n?"hidden":"flex group-hover:hidden"}`,children:a.jsx(MK,{name:e})}),a.jsx("span",{"data-testid":"project-switcher-chevron",className:`h-7 w-7 items-center justify-center rounded text-spur-text ${n?"flex":"hidden group-hover:flex"}`,children:a.jsx("svg",{className:`h-4 w-4 shrink-0 transition-transform ${n?"rotate-180 text-spur-accent":""}`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 6l4 4 4-4"})})})]});return a.jsxs("div",{className:`relative ${t?"flex items-center justify-center":"min-w-0 flex-1"}`,ref:d,children:[t?n?f:a.jsx(Br,{position:"right",tip:`Switch project: ${e}`,className:"block",children:f}):a.jsxs("button",{type:"button",onClick:()=>r(m=>!m),"aria-haspopup":"listbox","aria-expanded":n,"aria-label":"Switch project",title:e,"data-testid":"project-switcher-trigger",className:"flex w-full items-center justify-between gap-1 rounded-md px-1.5 py-1 text-left text-sm font-semibold text-spur-text hover:bg-spur-border/30 focus-visible:outline focus-visible:outline-2 focus-visible:outline-spur-accent",children:[a.jsx("span",{className:"font-semibold truncate",children:e}),a.jsx("svg",{className:`h-4 w-4 shrink-0 transition-transform ${n?"rotate-180":""}`,viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M4 6l4 4 4-4"})})]}),n&&a.jsxs("div",{role:"listbox","aria-label":"Registered projects","data-testid":"project-switcher-menu",className:`absolute z-50 w-64 rounded-md border border-spur-border bg-spur-surface p-1 shadow-lg ${t?"left-full top-0 ml-2":"left-0 top-full mt-1"}`,children:[a.jsx("div",{className:"px-2 py-1 text-xs font-medium text-spur-text-muted border-b border-spur-border/50 mb-1",children:"Projects"}),s.length===0?a.jsx("div",{className:"px-2 py-1.5 text-xs text-spur-text-muted",children:u||"No projects registered"}):s.map(m=>a.jsxs("button",{type:"button",role:"option","aria-selected":m.current,disabled:o===m.name,onClick:()=>p(m),"data-testid":`project-item-${m.name}`,className:`flex w-full items-center justify-between rounded px-2 py-1.5 text-xs text-left transition-colors ${m.current?"bg-spur-accent/15 text-spur-accent font-medium":"text-spur-text hover:bg-spur-border/30"}`,children:[a.jsxs("div",{className:"flex items-center gap-2 min-w-0 flex-1",children:[a.jsx("span",{className:`h-2 w-2 rounded-full shrink-0 ${m.running?"bg-green-500":"bg-gray-400"}`,title:m.running?`Running on port ${m.port}`:"Stopped"}),a.jsx("span",{className:"truncate",children:m.name})]}),o===m.name?a.jsx("span",{className:"text-[10px] text-spur-accent animate-pulse",children:"Starting..."}):m.current?a.jsx("span",{className:"text-[10px] font-semibold text-spur-accent",children:"current"}):m.running?a.jsxs("span",{className:"text-[10px] text-spur-text-muted",children:[":",m.port]}):a.jsx("span",{className:"text-[10px] text-spur-text-muted",children:"stopped"})]},m.path))]})]})}const AA="spur-theme";function FK(){try{const e=localStorage.getItem(AA);if(e==="light"||e==="dark")return e}catch{}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function PK(e){document.documentElement.setAttribute("data-theme",e);try{localStorage.setItem(AA,e)}catch{}}function BK(e){const t=e==="dark"?"light":"dark";return PK(t),t}function v1(){const[e,t]=g.useState(FK);g.useEffect(()=>{const r=window.matchMedia("(prefers-color-scheme: dark)"),s=i=>{if(!(()=>{try{return localStorage.getItem("spur-theme")}catch{return null}})()){const l=i.matches?"dark":"light";t(l),document.documentElement.setAttribute("data-theme",l)}};return r.addEventListener("change",s),()=>r.removeEventListener("change",s)},[]);const n=g.useCallback(()=>t(BK),[]);return a.jsx(Fe,{variant:"ghost",size:"sm",onClick:n,className:"text-spur-text-muted","aria-label":e==="dark"?"Switch to light mode":"Switch to dark mode",children:e==="dark"?"☀️":"🌙"})}const UK="Modules";function $K(){const[e,t]=g.useState(UK);return g.useEffect(()=>{const n=new AbortController;return Ge(new Request(`${nt()}/project`,{signal:n.signal})).then(async r=>{if(!r.ok)return;const s=await r.json();s.name&&t(s.name)}).catch(()=>{}),()=>n.abort()},[]),e}function zK({direction:e}){const t=e==="expand";return a.jsxs("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"}),a.jsx("line",{x1:"6",y1:"2",x2:"6",y2:"14"}),t?a.jsx("path",{d:"M9 6l2 2-2 2"}):a.jsx("path",{d:"M11 6l-2 2 2 2"})]})}function A1({collapsed:e,onToggle:t}){const n=e?"Expand sidebar":"Collapse sidebar";return a.jsx("button",{type:"button",onClick:t,"aria-label":n,title:n,"data-testid":e?"sidebar-expand":"sidebar-collapse",className:"flex h-8 w-8 items-center justify-center rounded-md text-spur-text-muted hover:bg-spur-accent/20 hover:text-spur-accent focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-spur-accent",children:a.jsx(zK,{direction:e?"expand":"collapse"})})}function k1({collapsed:e}){const t=a.jsx(C1,{to:"/board/settings","aria-label":"Open settings",title:"Open settings","data-testid":"sidebar-settings",className:({isActive:n})=>`flex h-8 w-8 items-center justify-center rounded-md transition-colors ${n?"bg-spur-accent/20 text-spur-accent":"text-spur-text-muted hover:bg-spur-accent/20 hover:text-spur-accent"} focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-spur-accent`,children:a.jsx("svg",{className:"h-4 w-4 shrink-0",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})});return e?a.jsx(Br,{position:"right",tip:"Settings",className:"block",children:t}):t}function HK({collapsed:e,onToggle:t,onMobileClose:n}){const r=$K(),{registry:s}=NA();return a.jsxs("aside",{className:`flex flex-col bg-spur-surface border-r border-spur-border ${e?"overflow-visible":"overflow-hidden"}`,children:[e?a.jsx("div",{className:"flex items-center justify-center border-b border-spur-border shrink-0 py-2",children:a.jsx(w1,{currentName:r,collapsed:!0})}):a.jsxs("div",{className:"flex items-center justify-between gap-1 p-3 border-b border-spur-border shrink-0",children:[a.jsx(w1,{currentName:r}),n&&a.jsx(Fe,{variant:"ghost",size:"sm",className:"text-spur-text-muted md:hidden",onClick:n,"aria-label":"Close navigation",children:"✕"})]}),a.jsx("nav",{className:`flex-1 ${e?"overflow-visible":"overflow-y-auto"}`,children:s.modules.filter(i=>i.id!=="settings").map(i=>{const o=i.sidebarLabel??i.name,l=a.jsxs(C1,{to:`/board/${i.route}`,className:({isActive:u})=>`flex items-center gap-2 px-3 py-2 text-sm transition-colors ${u?"bg-spur-accent/20 text-spur-accent":"text-spur-text-muted hover:text-spur-text hover:bg-spur-border/30"} ${e?"justify-center py-3":""}`,children:[a.jsx("span",{className:"text-lg",children:i.icon}),!e&&a.jsx("span",{children:o})]},i.id);if(e){const u=i.description?`${o}
|
|
322
322
|
${i.description}`:o;return a.jsx(Br,{position:"right",tip:u,className:"[&:before]:whitespace-pre-line block",children:l},i.id)}return l})}),a.jsx("div",{"data-testid":"sidebar-footer",className:`border-t border-spur-border shrink-0 ${e?"py-2 flex flex-col items-center gap-2":"p-3 flex items-center justify-between gap-2"}`,children:e?a.jsxs(a.Fragment,{children:[a.jsx(v1,{}),a.jsx(k1,{collapsed:!0}),a.jsx(A1,{collapsed:!0,onToggle:t})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(v1,{}),a.jsx(k1,{})]}),a.jsx(A1,{collapsed:!1,onToggle:t})]})})]})}function GK({children:e,mobileHeader:t,framed:n=!1}){return a.jsxs("main",{className:"flex flex-col h-full overflow-hidden bg-spur-bg",children:[t,a.jsx("div",{className:n?"flex flex-1 min-h-0 flex-col overflow-hidden":"flex-1 min-h-0 overflow-auto",children:e})]})}function WK({collapsed:e,onToggle:t,onMobileClose:n,children:r,actions:s}){return a.jsxs("aside",{className:"flex flex-col bg-spur-surface border-l border-spur-border overflow-hidden",children:[n&&a.jsx("div",{className:"hidden max-md:flex items-center justify-center py-2 shrink-0",children:a.jsx("div",{className:"w-10 h-1 rounded-full bg-spur-border"})}),a.jsxs("div",{className:"flex items-center justify-between p-3 border-b border-spur-border shrink-0",children:[!e&&a.jsx("span",{className:"text-sm font-semibold text-spur-text",children:r?"Context":""}),a.jsx("div",{className:"flex items-center gap-1",children:s}),a.jsxs("div",{className:"flex items-center gap-1",children:[n&&a.jsx(Fe,{variant:"ghost",size:"sm",className:"text-spur-text-muted md:hidden",onClick:n,"aria-label":"Close panel",children:"✕"}),a.jsx(Fe,{variant:"ghost",size:"sm",className:"text-spur-text-muted hidden md:inline-flex",onClick:t,"aria-label":e?"Expand panel":"Collapse panel",children:e?"◀":"▶"})]})]}),!e&&a.jsx("div",{className:"flex-1 overflow-y-auto p-3",children:r})]})}const qK=g.createContext(void 0);function VK(){const[e,t]=g.useState(()=>EK()),[n,r]=g.useState(!1),[s,i]=g.useState(!1),o=Pi(),{registry:l,hostDiagnostics:u}=NA(),c=(()=>{const N=o.pathname.split("/"),T=N.indexOf("board"),w=T>=0?N[T+1]:void 0;if(!w)return;const k=w==="modules"&&N[T+2]?`modules/${N[T+2]}`:w;return l.modules.find(F=>F.route===k)})();g.useLayoutEffect(()=>{const N=document.documentElement;N.style.setProperty("--sidebar-w",`${e.sidebarWidth}px`),N.style.setProperty("--rightpanel-w",`${e.rightPanelWidth}px`)},[e.sidebarWidth,e.rightPanelWidth]);const d=g.useCallback(N=>SK(N),[]),p=g.useCallback(()=>{t(N=>{const T={...N,sidebarCollapsed:!N.sidebarCollapsed};return d(T),T})},[d]),f=g.useCallback(()=>{t(N=>{const T={...N,rightPanelCollapsed:!N.rightPanelCollapsed};return d(T),T})},[d]),m=g.useCallback(N=>t(T=>{const w={...T,sidebarWidth:N};return d(w),w}),[d]),b=g.useCallback(N=>t(T=>{const w={...T,rightPanelWidth:N};return d(w),w}),[d]),x=g.useCallback(()=>{r(!1),i(!1)},[]),y=g.useCallback(N=>{N.key==="Escape"&&x()},[x]),E=c?.rightPanelComponent,v=c?.contributionType==="iframe";g.useLayoutEffect(()=>{E&&e.rightPanelCollapsed&&t(N=>({...N,rightPanelCollapsed:!1}))},[E,e.rightPanelCollapsed]);const S=a.jsxs("div",{className:"mobile-bar",children:[a.jsx(Fe,{variant:"ghost",size:"sm",className:"text-spur-text",onClick:()=>r(!0),"aria-label":"Open navigation",children:"☰"}),a.jsx("span",{className:"text-sm font-semibold text-spur-text",children:c?.name??"Spur"}),!v&&a.jsx(Fe,{variant:"ghost",size:"sm",className:"text-spur-text",onClick:()=>i(!0),"aria-label":"Open panel",children:"◧"})]}),A=n||s;return a.jsx(hq,{children:a.jsxs(kK,{children:[A&&a.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 md:hidden",onClick:x,onKeyDown:y,"aria-hidden":"true"}),a.jsx("div",{className:"board-layout","data-sidebar-collapsed":String(e.sidebarCollapsed),"data-rightpanel-collapsed":String(e.rightPanelCollapsed),"data-mobile-sidebar-open":String(n),"data-mobile-panel-open":String(s),"data-framed-workspace":String(v),children:a.jsxs(qK.Provider,{value:c,children:[a.jsx(HK,{collapsed:e.sidebarCollapsed&&!n,onToggle:p,onMobileClose:x}),a.jsx(Li,{targetVar:"--sidebar-w",onResizeEnd:m}),a.jsxs(GK,{mobileHeader:S,framed:v,children:[a.jsx(rL,{diagnostics:u}),a.jsx(zA,{})]}),!v&&a.jsxs(a.Fragment,{children:[a.jsx(Li,{targetVar:"--rightpanel-w",onResizeEnd:b}),a.jsx(WK,{collapsed:e.rightPanelCollapsed,onToggle:f,onMobileClose:x,children:E?c&&c.contributionType==="react"?a.jsx(jS,{moduleId:c.id,category:"panel",children:a.jsx(E,{})}):a.jsx(E,{}):null})]})]})}),!v&&a.jsx(jK,{activeModule:c}),a.jsx(_K,{})]})})}const YK=[{from:"workspace",to:"/board/projects"},{from:"inbox",to:"/board/projects/conversation"},{from:"teams",to:"/board/settings/agents"}];function kA(e){return e.contributionType==="react"||e.contributionType==="iframe"}function _1(e){const t=e.component;return kA(e)?a.jsx(jS,{moduleId:e.id,children:a.jsx(t,{})}):a.jsx(t,{})}function KK(e){return e.modules.find(t=>!kA(t))??e.defaultModule}function _A(e){const t=KK(e);return[{path:"/board",element:a.jsx(VK,{}),children:[{index:!0,element:a.jsx(mo,{to:t?`/board/${t.route}`:"/board",replace:!0})},...YK.flatMap(n=>[{path:n.from,element:a.jsx(mo,{to:n.to,replace:!0})},{path:`${n.from}/*`,element:a.jsx(mo,{to:n.to,replace:!0})}]),...e.modules.flatMap(n=>[{path:n.route,element:_1(n)},{path:`${n.route}/*`,element:_1(n)}])]},{path:"/",element:a.jsx(mo,{to:t?`/board/${t.route}`:"/board",replace:!0})}]}_A(Fi);function ZK(e=Fi){return HA(_A(e))}async function XK(e=()=>Pt.board.modules()){const t=await e().catch(()=>null),n=await dL(t,Fi.modules);try{return{registry:SA([...n.modules]),hostDiagnostics:n.hostDiagnostics}}catch(r){return{registry:Fi,hostDiagnostics:[...n.hostDiagnostics,{moduleId:"catalog",category:"catalog",message:r instanceof Error?r.message:String(r)}]}}}function aZ(){const[e,t]=g.useState(null);return g.useEffect(()=>{let n=!0;return XK().then(r=>{n&&t({value:r,router:ZK(r.registry)})}),()=>{n=!1}},[]),e?a.jsx(yK,{value:e.value,children:a.jsx(GA,{router:e.router})}):null}export{Fe as B,Mb as C,Ss as L,ia as M,ci as S,Zw as _,Pt as a,Lt as b,ev as c,aZ as d,XK as l,PH as p,yp as t,ex as u};
|